Class

eZ\Publish\API\Repository\Values\Translation\Plural

class Plural extends Translation

Class for translatable messages, which may contain plural forms.

The message might include replacements, in the form %[A-Za-z]%. Those are replaced by the values provided. A raw % can be escaped like %%.

You need to provide a singular and plural variant for the string. The strings provided should be english and will be translated depending on the environment language.

This interface follows the interfaces of XLiff, gettext, Symfony2 Translations and Zend_Translate. For singular forms you just provide a plain string (with optional placeholders without effects on the plural forms). For potential plural forms you always provide a singular variant and an english simple plural variant. No implementation supports multiple different plural forms in one single message.

The singular / plural string could, for Symfony2, for example be converted to "$singular|$plural", and you would call gettext like: ngettext( $singular, $plural, $count ).

Methods

__construct(string $singular, string $plural, array $values)

Construct plural message from singular, plural and value array.

Details

at line 67
public __construct(string $singular, string $plural, array $values)

Construct plural message from singular, plural and value array.

Parameters

string $singular
string $plural
array $values