diff --git a/core/lib/Drupal/Core/Language/LanguageManager.php b/core/lib/Drupal/Core/Language/LanguageManager.php index 79ff3bb..76b23d1 100644 --- a/core/lib/Drupal/Core/Language/LanguageManager.php +++ b/core/lib/Drupal/Core/Language/LanguageManager.php @@ -50,15 +50,6 @@ public function __construct(LanguageDefault $default_language) { } /** - * Translates a string to the current language or to a given language. - * - * @see \Drupal\Core\StringTranslation\TranslationInterface() - */ - protected function t($string, array $args = array(), array $options = array()) { - return new TranslationWrapper($string, $args, $options); - } - - /** * {@inheritdoc} */ public function isMultilingual() { @@ -95,13 +86,13 @@ public function getLanguageTypes() { public function getDefinedLanguageTypesInfo() { $this->definedLanguageTypesInfo = array( LanguageInterface::TYPE_INTERFACE => array( - 'name' => $this->t('Interface text'), - 'description' => $this->t('Order of language detection methods for interface text. If a translation of interface text is available in the detected language, it will be displayed.'), + 'name' => new TranslationWrapper('Interface text'), + 'description' => new TranslationWrapper('Order of language detection methods for interface text. If a translation of interface text is available in the detected language, it will be displayed.'), 'locked' => TRUE, ), LanguageInterface::TYPE_CONTENT => array( - 'name' => $this->t('Content'), - 'description' => $this->t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'), + 'name' => new TranslationWrapper('Content'), + 'description' => new TranslationWrapper('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'), 'locked' => TRUE, ), LanguageInterface::TYPE_URL => array( @@ -173,15 +164,15 @@ public function getLanguage($langcode) { */ public function getLanguageName($langcode) { if ($langcode == LanguageInterface::LANGCODE_NOT_SPECIFIED) { - return $this->t('None'); + return new TranslationWrapper('None'); } if ($language = $this->getLanguage($langcode)) { return $language->getName(); } if (empty($langcode)) { - return $this->t('Unknown'); + return new TranslationWrapper('Unknown'); } - return $this->t('Unknown (@langcode)', array('@langcode' => $langcode)); + return new TranslationWrapper('Unknown (@langcode)', array('@langcode' => $langcode)); } /** @@ -199,13 +190,13 @@ public function getDefaultLockedLanguages($weight = 0) { // early t() calls by using the TranslationWrapper. $languages[LanguageInterface::LANGCODE_NOT_SPECIFIED] = new Language(array( 'id' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - 'name' => $this->t('Not specified'), + 'name' => new TranslationWrapper('Not specified'), 'weight' => ++$weight, ) + $locked_language); $languages[LanguageInterface::LANGCODE_NOT_APPLICABLE] = new Language(array( 'id' => LanguageInterface::LANGCODE_NOT_APPLICABLE, - 'name' => $this->t('Not applicable'), + 'name' => new TranslationWrapper('Not applicable'), 'weight' => ++$weight, ) + $locked_language); @@ -363,7 +354,6 @@ public function getConfigOverrideLanguage() { return $this->getCurrentLanguage(); } - /** * Filters the full list of languages based on the value of the flag. * @@ -395,7 +385,7 @@ protected function filterLanguages(array $languages, $flags = LanguageInterface: $default = new Language( array( 'id' => $defaultLanguage->getId(), - 'name' => $this->t("Site's default language (@lang_name)", + 'name' => new TranslationWrapper("Site's default language (@lang_name)", array('@lang_name' => $defaultLanguage->getName())), 'direction' => $defaultLanguage->getDirection(), 'weight' => $defaultLanguage->getWeight(),