protected StringTranslationTrait::getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
\Drupal\locale\PluralFormulaInterface::getNumberOfPlurals()
protected function getNumberOfPlurals($langcode = NULL) { if (\Drupal::hasService('locale.plural.formula')) { return \Drupal::service('locale.plural.formula')->getNumberOfPlurals($langcode); } // We assume 2 plurals if Locale's services are not available. return 2; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StringTranslation!StringTranslationTrait.php/function/StringTranslationTrait::getNumberOfPlurals/8.1.x