diff -u b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php --- b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php @@ -104,14 +104,2 @@ - /** - * Returns the number of plurals supported by a given language. - * - * @param null|string $langcode - * (optional) The language code. If not provided, the current language - * will be used. - * - * @return int - * Number of plural variants supported by the given language. - */ - public function getNumberOfPlurals($langcode = NULL); - } @@ -137,2 +125,14 @@ + /** + * Returns the number of plurals supported by a given language. + * + * @param null|string $langcode + * (optional) The language code. If not provided, the current language + * will be used. + * + * @return int + * Number of plural variants supported by the given language. + */ + public function getNumberOfPlurals($langcode = NULL); + } diff -u b/core/modules/locale/src/PluralFormula.php b/core/modules/locale/src/PluralFormula.php --- b/core/modules/locale/src/PluralFormula.php +++ b/core/modules/locale/src/PluralFormula.php @@ -65,7 +65,7 @@ 'plurals' => $plural_count, 'formula' => $formula, ]; - $this->state->set('locale.translation.plurals', $this->formulae); + $this->state->set('locale.translation.formulae', $this->formulae); return $this; } @@ -76,7 +76,7 @@ // Ensure that the formulae are loaded. $this->loadFormulae(); - // We also 2 plurals if there is no explicit information yet. + // Set the langcode to use. $langcode = $langcode ?: $this->languageManager->getCurrentLanguage()->getId(); // We assume 2 plurals if there is no explicit information yet. @@ -95,13 +95,13 @@ } /** - * Loads the formulae and stores them on the object if not set. + * Loads the formulae and stores them on the PluralFormula object if not set. * * @return [] */ protected function loadFormulae() { if (!isset($this->formulae)) { - $this->formulae = $this->state->get('locale.translation.plurals', []); + $this->formulae = $this->state->get('locale.translation.formulae', []); } } diff -u b/core/modules/locale/src/PluralFormulaInterface.php b/core/modules/locale/src/PluralFormulaInterface.php --- b/core/modules/locale/src/PluralFormulaInterface.php +++ b/core/modules/locale/src/PluralFormulaInterface.php @@ -18,7 +18,7 @@ * @param int $plural_count * The number of plural forms. * @param array $formula - * An array for formulas. + * An array of formulae. * * @return self * The PluralFormula object. @@ -44,7 +44,7 @@ * The language code to get the formula for. * * @return array - * An array for formulas. + * An array of formulae. */ public function getFormula($langcode); diff -u b/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php b/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php --- b/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php +++ b/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php @@ -60,7 +60,7 @@ * Reboots the kernel to set custom translations in Settings. */ protected function rebootAndPrepareSettings() { - // Reboot the container so that difference services are injected and the new + // Reboot the container so that different services are injected and the new // settings are picked. $kernel = $this->container->get('kernel'); $kernel->shutdown();