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

1
2
3
4
public function getFormula($langcode) {
  $this->loadFormulae();
  return isset($this->formulae[$langcode]['formula']) ? $this->formulae[$langcode]['formula'] : FALSE;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.