diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationManager.php b/core/lib/Drupal/Core/StringTranslation/TranslationManager.php index 9820d4c..f455a9c 100644 --- a/core/lib/Drupal/Core/StringTranslation/TranslationManager.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslationManager.php @@ -163,9 +163,7 @@ public function translate($string, array $args = array(), array $options = array * {@inheritdoc} */ public function formatPlural($count, $singular, $plural, array $args = array(), array $options = array()) { - // Join both forms to search a translation. $translatable_string = implode(LOCALE_PLURAL_DELIMITER, array($singular, $plural)); - // Translate as usual. $translated_strings = $this->translate($translatable_string, $args, $options); return $this->formatPluralTranslated($count, $translated_strings, $args, $options); } @@ -175,11 +173,10 @@ public function formatPlural($count, $singular, $plural, array $args = array(), */ public function formatPluralTranslated($count, $translation, array $args = array(), array $options = array()) { $args['@count'] = $count; - // Split joined translation strings into array. $translated_array = explode(LOCALE_PLURAL_DELIMITER, $translation); if ($count == 1) { - return SafeMarkup::set($translated_array[0]); + return String::format($translated_array[0], $args); } // Get the plural index through the gettext formula. @@ -202,12 +199,7 @@ public function formatPluralTranslated($count, $translation, array $args = array } } - if (empty($args)) { - return SafeMarkup::set($return); - } - else { - return String::format($return, $args); - } + return String::format($return, $args); } /**