diff --git a/core/modules/config_translation/src/ConfigMapperInterface.php b/core/modules/config_translation/src/ConfigMapperInterface.php index ac3d531..f794a10 100644 --- a/core/modules/config_translation/src/ConfigMapperInterface.php +++ b/core/modules/config_translation/src/ConfigMapperInterface.php @@ -205,22 +205,6 @@ public function getConfigData(); public function getLangcode(); /** - * Returns language object for the configuration. - * - * If the language of the configuration files is not a configured language on - * the site and it is English, we return a dummy language object to represent - * the built-in language. - * - * @return \Drupal\Core\Language\LanguageInterface - * A configured language object instance or a dummy English language object. - * - * @throws \RuntimeException - * Throws an exception if the language codes in the config files don't - * match. - */ - public function getLanguageWithFallback(); - - /** * Returns the name of the type of data the mapper encapsulates. * * @return string diff --git a/core/modules/config_translation/src/ConfigNamesMapper.php b/core/modules/config_translation/src/ConfigNamesMapper.php index ee1d0ac..ca4e8d8 100644 --- a/core/modules/config_translation/src/ConfigNamesMapper.php +++ b/core/modules/config_translation/src/ConfigNamesMapper.php @@ -410,24 +410,6 @@ public function getLangcode() { /** * {@inheritdoc} */ - public function getLanguageWithFallback() { - $langcode = $this->getLangcode(); - $language = $this->languageManager->getLanguage($langcode); - // If the language of the file is English but English is not a configured - // language on the site, create a mock language object to represent this - // language run-time. In this case, the title of the language is - // 'Built-in English' because we assume such configuration is shipped with - // core and the modules and not custom created. (In the later case an - // English language configured on the site is assumed.) - if (empty($language) && $langcode == 'en') { - $language = new Language(array('id' => 'en', 'name' => $this->t('Built-in English'))); - } - return $language; - } - - /** - * {@inheritdoc} - */ public function getConfigData() { $config_data = array(); foreach ($this->getConfigNames() as $name) { diff --git a/core/modules/config_translation/src/Controller/ConfigTranslationController.php b/core/modules/config_translation/src/Controller/ConfigTranslationController.php index 72fe9cc..9c7fd67 100644 --- a/core/modules/config_translation/src/Controller/ConfigTranslationController.php +++ b/core/modules/config_translation/src/Controller/ConfigTranslationController.php @@ -127,18 +127,12 @@ public function itemPage(Request $request, RouteMatchInterface $route_match, $pl $page = array(); $page['#title'] = $this->t('Translations for %label', array('%label' => $mapper->getTitle())); - // It is possible the original language this configuration was saved with is - // not on the system. For example, the configuration shipped in English but - // the site has no English configured. Represent the original language in - // the table even if it is not currently configured. $languages = $this->languageManager->getLanguages(); $original_langcode = $mapper->getLangcode(); if (!isset($languages[$original_langcode])) { + // If the language is not configured on the site, create a dummy language + // object for this listing only to ensure the user gets useful info. $language_name = $this->languageManager->getLanguageName($original_langcode); - if ($original_langcode == 'en') { - $language_name = $this->t('Built-in English'); - } - // Create a dummy language object for this listing only. $languages[$original_langcode] = new Language(array('id' => $original_langcode, 'name' => $language_name)); } diff --git a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php index 2831fd9..9e5372f 100644 --- a/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php +++ b/core/modules/config_translation/src/Form/ConfigTranslationFormBase.php @@ -144,7 +144,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $ $this->mapper = $mapper; $this->language = $language; - $this->sourceLanguage = $this->mapper->getLanguageWithFallback(); + $this->sourceLanguage = $this->languageManager->getLanguage($this->mapper->getLangcode()); // Get base language configuration to display in the form before setting the // language to use for the form. This avoids repetitively settings and diff --git a/core/modules/language/language.module b/core/modules/language/language.module index f66bff2..ae8c2e2 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -161,21 +161,6 @@ function language_process_language_select($element) { $element['#options'][$langcode] = $language->isLocked() ? t('- @name -', array('@name' => $language->getName())) : $language->getName(); } } - // Add "Built-in English" language to the select when the default value is - // set to English but it does not exist in the options list. - // - // Drupal core includes configuration shipped in English, including default - // views, content types, user roles, filter formats, etc. To keep the Drupal - // software update-able, as well as translations update-able, we keep these - // configuration files in English even when installed in a foreign language. - // However, administrators can remove English, in which case editing such a - // configuration would lead to the language settings being changed on it. We - // avoid that by including this option and letting administrators keep it - // in English. - if (isset($element['#default_value']) && $element['#default_value'] == 'en' && !isset($element['#options']['en'])) { - // Prepend the default language at the beginning of the list. - $element['#options'] = array('en' => t('Built-in English')) + $element['#options']; - } return $element; } diff --git a/core/modules/locale/src/LocaleConfigSubscriber.php b/core/modules/locale/src/LocaleConfigSubscriber.php index efe694e..ee20daf 100644 --- a/core/modules/locale/src/LocaleConfigSubscriber.php +++ b/core/modules/locale/src/LocaleConfigSubscriber.php @@ -135,7 +135,7 @@ protected function updateLocaleStorage(StorableConfigBase $config, $langcode, ar * The active configuration data or override data. * @param array|\Drupal\Core\StringTranslation\TranslationWrapper[] $translatable * The translatable array structure. - * @see \Drupal\locale\LocaleConfigManager::getTranslatableData(). + * @see \Drupal\locale\LocaleConfigManager::getTranslatableData() * @param string $langcode * The language code to process the array with. * @param array $reference_config