function PluralFormula::setPluralFormula
Same name in other branches
- 8.9.x core/modules/locale/src/PluralFormula.php \Drupal\locale\PluralFormula::setPluralFormula()
- 10 core/modules/locale/src/PluralFormula.php \Drupal\locale\PluralFormula::setPluralFormula()
- 11.x core/modules/locale/src/PluralFormula.php \Drupal\locale\PluralFormula::setPluralFormula()
Overrides PluralFormulaInterface::setPluralFormula
File
-
core/
modules/ locale/ src/ PluralFormula.php, line 57
Class
- PluralFormula
- Manages the storage of plural formula per language in state.
Namespace
Drupal\localeCode
public function setPluralFormula($langcode, $plural_count, array $formula) {
// Ensure that the formulae are loaded.
$this->loadFormulae();
$this->formulae[$langcode] = [
'plurals' => $plural_count,
'formula' => $formula,
];
$this->state
->set('locale.translation.formulae', $this->formulae);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.