3 namespace Drupal\locale;
6 * An interface for a service providing plural formulae.
8 interface PluralFormulaInterface {
11 * @param string $langcode
12 * The language code to get the formula for.
13 * @param int $plural_count
14 * The number of plural forms.
15 * @param array $formula
16 * An array of formulae.
19 * The PluralFormula object.
21 public function setPluralFormula($langcode, $plural_count, array $formula);
24 * Returns the number of plurals supported by a given language.
26 * @param null|string $langcode
27 * (optional) The language code. If not provided, the current language
31 * Number of plural variants supported by the given language.
33 public function getNumberOfPlurals($langcode = NULL);
36 * Gets the plural formula for a langcode.
38 * @param string $langcode
39 * The language code to get the formula for.
42 * An array of formulae.
44 public function getFormula($langcode);
47 * Resets the static formulae cache.
50 * The PluralFormula object.
52 public function reset();