PluralFormula
class PluralFormula implements PluralFormulaInterface (View source)
Manages the storage of plural formula per language in state.
Properties
| protected LanguageManagerInterface | $languageManager | ||
| protected StateInterface | $state | ||
| protected array | $formulae | The plural formula and count keyed by langcode. |
Methods
setPluralFormula(string $langcode, int $plural_count, array $formula)
No description
int
getNumberOfPlurals(null|string $langcode = NULL)
Returns the number of plurals supported by a given language.
array
getFormula(string $langcode)
Gets the plural formula for a langcode.
array
loadFormulae()
Loads the formulae and stores them on the PluralFormula object if not set.
reset()
Resets the static formulae cache.
Details
__construct(LanguageManagerInterface $language_manager, StateInterface $state)
No description
PluralFormulaInterface
setPluralFormula(string $langcode, int $plural_count, array $formula)
No description
int
getNumberOfPlurals(null|string $langcode = NULL)
Returns the number of plurals supported by a given language.
array
getFormula(string $langcode)
Gets the plural formula for a langcode.
protected array
loadFormulae()
Loads the formulae and stores them on the PluralFormula object if not set.
PluralFormulaInterface
reset()
Resets the static formulae cache.