PluralFormulaInterface::reset

public PluralFormulaInterface::reset() Resets the static formulae cache. Return value self The PluralFormula object. File core/modules/locale/src/PluralFormulaInterface.php, line 52 Class PluralFormulaInterface An interface for a service providing plural formulae. Namespace Drupal\locale Code public function reset();

PluralFormulaInterface::getNumberOfPlurals

public PluralFormulaInterface::getNumberOfPlurals($langcode = NULL) Returns the number of plurals supported by a given language. Parameters null|string $langcode: (optional) The language code. If not provided, the current language will be used. Return value int Number of plural variants supported by the given language. File core/modules/locale/src/PluralFormulaInterface.php, line 33 Class PluralFormulaInterface An interface for a service providing plural formulae. Namespace Drupal\loc

PluralFormulaInterface::getFormula

public PluralFormulaInterface::getFormula($langcode) Gets the plural formula for a langcode. Parameters string $langcode: The language code to get the formula for. Return value array An array of formulae. File core/modules/locale/src/PluralFormulaInterface.php, line 44 Class PluralFormulaInterface An interface for a service providing plural formulae. Namespace Drupal\locale Code public function getFormula($langcode);

PluralFormulaInterface

An interface for a service providing plural formulae. Hierarchy interface \Drupal\locale\PluralFormulaInterface File core/modules/locale/src/PluralFormulaInterface.php, line 8 Namespace Drupal\locale Members Name Modifiers Type Description PluralFormulaInterface::getFormula public function Gets the plural formula for a langcode. PluralFormulaInterface::getNumberOfPlurals public function Returns the number of plurals supported by a given language. PluralFormulaI

PluralFormula::__construct

public PluralFormula::__construct(LanguageManagerInterface $language_manager, StateInterface $state) Parameters \Drupal\Core\Language\LanguageManagerInterface $language_manager: \Drupal\Core\State\StateInterface $state: File core/modules/locale/src/PluralFormula.php, line 47 Class PluralFormula Manages the storage of plural formula per language in state. Namespace Drupal\locale Code public function __construct(LanguageManagerInterface $language_manager, StateInterface $state) { $thi

PluralFormula::setPluralFormula

public PluralFormula::setPluralFormula($langcode, $plural_count, array $formula) Parameters string $langcode: The language code to get the formula for. int $plural_count: The number of plural forms. array $formula: An array of formulae. Return value self The PluralFormula object. Overrides PluralFormulaInterface::setPluralFormula File core/modules/locale/src/PluralFormula.php, line 55 Class PluralFormula Manages the storage of plural formula per language in state. Namespace Drupal\loc

PluralFormula::reset

public PluralFormula::reset() Resets the static formulae cache. Return value self The PluralFormula object. Overrides PluralFormulaInterface::reset File core/modules/locale/src/PluralFormula.php, line 106 Class PluralFormula Manages the storage of plural formula per language in state. Namespace Drupal\locale Code public function reset() { $this->formulae = NULL; return $this; }

PluralFormula::loadFormulae

protected PluralFormula::loadFormulae() Loads the formulae and stores them on the PluralFormula object if not set. Return value [] File core/modules/locale/src/PluralFormula.php, line 97 Class PluralFormula Manages the storage of plural formula per language in state. Namespace Drupal\locale Code protected function loadFormulae() { if (!isset($this->formulae)) { $this->formulae = $this->state->get('locale.translation.formulae', []); } }

PluralFormula::getNumberOfPlurals

public PluralFormula::getNumberOfPlurals($langcode = NULL) Returns the number of plurals supported by a given language. Parameters null|string $langcode: (optional) The language code. If not provided, the current language will be used. Return value int Number of plural variants supported by the given language. Overrides PluralFormulaInterface::getNumberOfPlurals File core/modules/locale/src/PluralFormula.php, line 70 Class PluralFormula Manages the storage of plural formula per language

PluralFormula::getFormula

public PluralFormula::getFormula($langcode) Gets the plural formula for a langcode. Parameters string $langcode: The language code to get the formula for. Return value array An array of formulae. Overrides PluralFormulaInterface::getFormula File core/modules/locale/src/PluralFormula.php, line 87 Class PluralFormula Manages the storage of plural formula per language in state. Namespace Drupal\locale Code public function getFormula($langcode) { $this->loadFormulae(); return isse