diff --git a/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php b/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php index 89e602f..5a50152 100644 --- a/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php +++ b/core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php @@ -145,6 +145,12 @@ public function render() { * @return int */ protected function getPluralIndex() { + // If there is no translation in the target language, we need to use the + // default language's index. + if (!$this->getStringTranslation()->getStringTranslation($this->getOption('langcode'), $this->getUntranslatedString(), $this->getOption('context')) && $this->getOption('langcode')) { + return -1; + } + // We have to test both if the function and the service exist since in // certain situations it is possible that locale code might be loaded but // the service does not exist. For example, where the parent test site has