Property | Type | Description | |
---|---|---|---|
$cache | Neos\Cache\Frontend\VariableFrontend | ||
$cldrRepository | |||
$rulesets | array | One ruleset contains one or more rules (at most 5, one for every plural form - zero, one, two, few, many - a rule 'other' is implicit). There can also be NULL ruleset, used by languages which don't have plurals. A rule is an array with following elements: 'modulo' => $x | FALSE, 'condition' => array(0 => 'conditionName', 1 => $x, 2 => $y), 'logicalOperator' => 'and' | 'or' | FALSE Legend: - if 'modulo' key has an integer value, tested variable (call it $n) has to be replaced with the remainder of division of $n by $x. Otherwise unchanged $n is used for conditional test. - 'condition' is an indexed array where first element is a name of test condition (one of: is, isnot, in, notin, within, notwithin). Second element is a value to compare $n with. Third element is optional, and is used only for tests where range is needed (last 4 from the list above) - 'logicalOperator' represents a logical operation to be done with next subrule in chain. If current subrule is a last one (or only one), this element is set to FALSE. | |
$rulesetsIndices | array | An associative array holding information which ruleset is used by given locale. One or more locales can use the same ruleset. |
Method | Description | |
---|---|---|
getPluralForm ( mixed $quantity, |
Returns matching plural form based on $quantity and $locale provided. | |
getPluralForms ( |
Returns array of plural forms available for particular locale. | |
initializeObject ( ) : void | Constructs the reader, loading parsed data from cache if available. | |
injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void | Injects the Flow_I18n_Cldr_Reader_PluralsReader cache | |
injectCldrRepository ( |
Method | Description | |
---|---|---|
generateRulesets ( ) : void | Generates an internal representation of plural rules which can be found in plurals.xml CLDR file. | |
parseRule ( string $rule ) : array | Parses a plural rule from CLDR. |
protected generateRulesets ( ) : void | ||
return | void |
public getPluralForm ( mixed $quantity, |
||
$quantity | mixed | A number to find plural form for (float or int) |
$locale | ||
return | string | One of plural form constants |
public getPluralForms ( |
||
$locale | Locale to return plural forms for | |
return | array | Plural forms' names (one, zero, two, few, many, other) available for language set in this model |
public initializeObject ( ) : void | ||
return | void |
public injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void | ||
$cache | Neos\Cache\Frontend\VariableFrontend | |
return | void |
public injectCldrRepository ( |
||
$repository | ||
return | void |
protected VariableFrontend,Neos\Cache\Frontend $cache | ||
return | Neos\Cache\Frontend\VariableFrontend |
protected CldrRepository,Neos\Flow\I18n\Cldr $cldrRepository | ||
return |
protected array $rulesets | ||
return | array |
protected array $rulesetsIndices | ||
return | array |