diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index a6e918f0bed9d7a47de29f8397c38e3fe27d5530..52cca498ec225c2ddbdcd3720d7afabe55a5d8ef 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1664,10 +1664,7 @@ function install_download_additional_translations_operations(&$install_state) { // If a non-English language was selected, change the default language and // remove English. if ($langcode != 'en') { - \Drupal::configFactory()->getEditable('system.site') - ->set('langcode', $langcode) - ->set('default_langcode', $langcode) - ->save(); + \Drupal::configFactory()->getEditable('system.site')->set('langcode', $langcode)->save(); \Drupal::service('language.default')->set($language); if (empty($install_state['profile_info']['keep_english'])) { entity_delete_multiple('configurable_language', array('en')); diff --git a/core/includes/install.inc b/core/includes/install.inc index 61d286bdec821373b79e9343463fb0c7b00114b5..e247378750d159ae0db9516750614578760c33c7 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -620,7 +620,6 @@ function drupal_install_system($install_state) { if (isset($install_state['parameters']['langcode'])) { \Drupal::configFactory()->getEditable('system.site') ->set('langcode', $install_state['parameters']['langcode']) - ->set('default_langcode', $install_state['parameters']['langcode']) ->save(); } } diff --git a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php index 5790294609347bd6ce521b12303f1a265ba7cf9f..44c14f198645311354a754dd68def41b6cf0465b 100644 --- a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php +++ b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php @@ -145,7 +145,7 @@ function testPerUserLoginFloodControl() { */ function testLocale() { ConfigurableLanguage::createFromLangcode('de')->save(); - $this->config('system.site')->set('default_langcode', 'de')->save(); + $this->config('system.site')->set('langcode', 'de')->save(); $account = $this->drupalCreateUser(); $url = Url::fromRoute('router_test.11'); diff --git a/core/modules/ckeditor/src/Tests/CKEditorTest.php b/core/modules/ckeditor/src/Tests/CKEditorTest.php index 279b56f3b5fce58851aaed1e3216cfe70b44492e..ab303b60d4e69651ef55ae550e3ba4692d82374f 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorTest.php @@ -406,7 +406,7 @@ function testJSTranslation() { protected function assertCKEditorLanguage($langcode = 'fr') { // Set French as the site default language. ConfigurableLanguage::createFromLangcode('fr')->save(); - $this->config('system.site')->set('default_langcode', 'fr')->save(); + $this->config('system.site')->set('langcode', 'fr')->save(); // Reset the language manager so new negotiations attempts will fall back on // French. Reinject the language manager CKEditor to use the current one. diff --git a/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php b/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php index f21c30c61784ad4a943e3fe9ddb7f9208f2e2d9e..9ecf5ae4a9d09e092f8692c5710871cce8178f27 100644 --- a/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php +++ b/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php @@ -75,7 +75,7 @@ function testSiteNameTranslation() { // overrides still work. $language_manager = \Drupal::languageManager()->reset(); $this->assertTrue($language_manager->isMultilingual(), 'The test site is multilingual.'); - $this->config('system.site')->set('default_langcode', 'xx')->save(); + $this->config('system.site')->set('langcode', 'xx')->save(); ConfigurableLanguage::load('en')->delete(); $this->assertFalse($language_manager->isMultilingual(), 'The test site is monolingual.'); diff --git a/core/modules/language/src/EventSubscriber/ConfigSubscriber.php b/core/modules/language/src/EventSubscriber/ConfigSubscriber.php index ef3f65d5ef1307bd877fb610548c5a6ded01b162..2b1c73c6cb5c921a2c69ad28333522e38a79b534 100644 --- a/core/modules/language/src/EventSubscriber/ConfigSubscriber.php +++ b/core/modules/language/src/EventSubscriber/ConfigSubscriber.php @@ -54,8 +54,8 @@ public function __construct(LanguageManagerInterface $language_manager, Language */ public function onConfigSave(ConfigCrudEvent $event) { $saved_config = $event->getConfig(); - if ($saved_config->getName() == 'system.site' && $event->isChanged('default_langcode')) { - $language = $this->languageManager->getLanguage($saved_config->get('default_langcode')); + if ($saved_config->getName() == 'system.site' && $event->isChanged('langcode')) { + $language = $this->languageManager->getLanguage($saved_config->get('langcode')); // During an import the language might not exist yet. if ($language) { $this->languageDefault->set($language); diff --git a/core/modules/language/src/LanguageListBuilder.php b/core/modules/language/src/LanguageListBuilder.php index aa018dc47ac45e039b6fd7a23ffdde6ae226e267..b8f64544040a6fa471a03768cad78794a694c1e7 100644 --- a/core/modules/language/src/LanguageListBuilder.php +++ b/core/modules/language/src/LanguageListBuilder.php @@ -152,7 +152,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // Save the default language if changed. $new_id = $form_state->getValue('site_default_language'); if ($new_id != $this->languageManager->getDefaultLanguage()->getId()) { - $this->configFactory->getEditable('system.site')->set('default_langcode', $new_id)->save(); + $this->configFactory->getEditable('system.site')->set('langcode', $new_id)->save(); $this->languageManager->reset(); } diff --git a/core/modules/language/src/LanguageServiceProvider.php b/core/modules/language/src/LanguageServiceProvider.php index de2fa6ff9ee923f99ed7d8ce30d0901fb6041851..d7c4dddb3fa4895646cd1c1bd5a99a7a8a094cc6 100644 --- a/core/modules/language/src/LanguageServiceProvider.php +++ b/core/modules/language/src/LanguageServiceProvider.php @@ -97,7 +97,7 @@ protected function isMultilingual() { protected function getDefaultLanguageValues() { $config_storage = BootstrapConfigStorageFactory::get(); $system = $config_storage->read('system.site'); - $default_language = $config_storage->read(static::CONFIG_PREFIX . $system['default_langcode']); + $default_language = $config_storage->read(static::CONFIG_PREFIX . $system['langcode']); if (is_array($default_language)) { return $default_language; } diff --git a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php b/core/modules/language/src/Tests/LanguageConfigurationElementTest.php index 1d4ee2753b8f897a3761c1afe95ec7865051d0ef..f4e1378b7299c729a76d9eccb3a20aeb5a1cd871 100644 --- a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php +++ b/core/modules/language/src/Tests/LanguageConfigurationElementTest.php @@ -116,7 +116,7 @@ public function testDefaultLangcode() { $configurable_language = entity_load('configurable_language', $old_default->getId()); $this->assertTrue($configurable_language->isDefault(), 'The en language entity is flagged as the default language.'); - $this->config('system.site')->set('default_langcode', 'cc')->save(); + $this->config('system.site')->set('langcode', 'cc')->save(); ContentLanguageSettings::loadByEntityTypeBundle('entity_test','custom_bundle') ->setLanguageAlterable(TRUE) ->setDefaultLangcode(LanguageInterface::LANGCODE_SITE_DEFAULT) diff --git a/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php b/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php index 46b30416fc674e66ee4a3f19c2b891a7eb16b77f..1a7a815ec976c0c054f9b0642f1a8dadae6fa20e 100644 --- a/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php +++ b/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php @@ -43,7 +43,7 @@ function testDependencyInjectedNewDefaultLanguage() { $default_language = ConfigurableLanguage::load(\Drupal::languageManager()->getDefaultLanguage()->getId()); // Change the language default object to different values. ConfigurableLanguage::createFromLangcode('fr')->save(); - $this->config('system.site')->set('default_langcode', 'fr')->save(); + $this->config('system.site')->set('langcode', 'fr')->save(); // The language system creates a Language object which contains the // same properties as the new default language object. @@ -60,7 +60,7 @@ function testDependencyInjectedNewDefaultLanguage() { } // Re-save the previous default language and the delete should work. - $this->config('system.site')->set('default_langcode', $default_language->getId())->save(); + $this->config('system.site')->set('langcode', $default_language->getId())->save(); entity_delete_multiple('configurable_language', array('fr')); $result = \Drupal::languageManager()->getCurrentLanguage(); diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php index 99d4778be6e7af19bb7f4ee28e3c8b40eef6fe87..f801b6ae8889a4b5d9749a63e0d9a02789ed82fb 100644 --- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php @@ -93,7 +93,7 @@ function testUILanguageNegotiation() { // be some bug. $default_language = \Drupal::languageManager()->getDefaultLanguage(); ConfigurableLanguage::createFromLangcode($langcode_browser_fallback)->save(); - $this->config('system.site')->set('default_langcode', $langcode_browser_fallback)->save(); + $this->config('system.site')->set('langcode', $langcode_browser_fallback)->save(); ConfigurableLanguage::createFromLangcode($langcode)->save(); // We will look for this string in the admin/config screen to see if the @@ -106,7 +106,7 @@ function testUILanguageNegotiation() { // Now the t()'ed string is in db so switch the language back to default. // This will rebuild the container so we need to rebuild the container in // the test environment. - $this->config('system.site')->set('default_langcode', $default_language->getId())->save(); + $this->config('system.site')->set('langcode', $default_language->getId())->save(); $this->config('language.negotiation')->set('url.prefixes.en', '')->save(); $this->rebuildContainer(); diff --git a/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php b/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php index ef53b8c897af6e24794910d9f8743eec6101080b..05220105ffe6043f44c20f5d8789fd70ae0e9402 100644 --- a/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php +++ b/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php @@ -32,7 +32,7 @@ public function setUp() { // Change the language default object to different values. ConfigurableLanguage::createFromLangcode('fr')->save(); - $this->config('system.site')->set('default_langcode', 'fr')->save(); + $this->config('system.site')->set('langcode', 'fr')->save(); $this->drupalLogin($this->rootUser); } diff --git a/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php b/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php index a5786b135923587835df01680da803be0feba916..f94db02971030bebb53ec4f020470e6b1d6e8f95 100644 --- a/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php +++ b/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php @@ -30,7 +30,7 @@ class LocaleTranslatedSchemaDefinitionTest extends WebTestBase { protected function setUp() { parent::setUp(); ConfigurableLanguage::createFromLangcode('fr')->save(); - $this->config('system.site')->set('default_langcode', 'fr')->save(); + $this->config('system.site')->set('langcode', 'fr')->save(); // Make sure new entity type definitions are processed. \Drupal::service('entity.definition_update_manager')->applyUpdates(); // Clear all caches so that the base field definition, its cache in the diff --git a/core/modules/menu_ui/src/Tests/MenuLanguageTest.php b/core/modules/menu_ui/src/Tests/MenuLanguageTest.php index 085722fdf2fdbc072ae50dadbaba898a0afb1ccb..59b045871aa390b0e9453eeb944f922498ff0ed1 100644 --- a/core/modules/menu_ui/src/Tests/MenuLanguageTest.php +++ b/core/modules/menu_ui/src/Tests/MenuLanguageTest.php @@ -155,7 +155,7 @@ function testMenuLanguageRemovedEnglish() { // Remove English language. To do that another language has to be set as // default. - $this->config('system.site')->set('default_langcode', 'cs')->save(); + $this->config('system.site')->set('langcode', 'cs')->save(); entity_delete_multiple('configurable_language', array('en')); // Save the menu again and check if the language is still the same. diff --git a/core/modules/system/config/install/system.site.yml b/core/modules/system/config/install/system.site.yml index 403e4640967643335e88aa7dc9620d7c975042f7..10e2be2e7e59ea603fe32618799b2fdbe9ff04e7 100644 --- a/core/modules/system/config/install/system.site.yml +++ b/core/modules/system/config/install/system.site.yml @@ -9,4 +9,3 @@ page: admin_compact_mode: false weight_select_max: 100 langcode: en -default_langcode: en diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml index ba8fa1598b34dcee0aaa86133d1552806d57df8f..6888a56e253d6db379badaff7a0599b01457614c 100644 --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.schema.yml @@ -37,10 +37,7 @@ system.site: label: 'Weight element maximum value' langcode: type: string - label: 'Language code' - default_langcode: - type: string - label: 'Site default language code' + label: 'Default language' mail_notification: type: string label: 'Notification email address' diff --git a/core/modules/system/src/Tests/Common/FormatDateTest.php b/core/modules/system/src/Tests/Common/FormatDateTest.php index 9d9a265f225206a5f0e3ce9b33c76a3466662202..63576fece142306d689fdb7ff26caf317e267f16 100644 --- a/core/modules/system/src/Tests/Common/FormatDateTest.php +++ b/core/modules/system/src/Tests/Common/FormatDateTest.php @@ -96,7 +96,7 @@ function testFormatDate() { $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London', 'en'), 'Monday, 26-Mar-07 01:00:00 BST', 'Test a different time zone.'); // Change the default language and timezone. - $this->config('system.site')->set('default_langcode', static::LANGCODE)->save(); + $this->config('system.site')->set('langcode', static::LANGCODE)->save(); date_default_timezone_set('America/Los_Angeles'); $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Sunday, 25-Mar-07 17:00:00 PDT', 'Test a different language.'); diff --git a/core/modules/system/src/Tests/Theme/TwigTransTest.php b/core/modules/system/src/Tests/Theme/TwigTransTest.php index 85ba19a22fcf6f5fbddd68d0377f97a05963e8cf..7f21b2dee41475bc6ad1d8fbe434f1a17292eacb 100644 --- a/core/modules/system/src/Tests/Theme/TwigTransTest.php +++ b/core/modules/system/src/Tests/Theme/TwigTransTest.php @@ -70,7 +70,7 @@ protected function setUp() { $this->installLanguages(); // Assign Lolspeak (xx) to be the default language. - $this->config('system.site')->set('default_langcode', 'xx')->save(); + $this->config('system.site')->set('langcode', 'xx')->save(); $this->rebuildContainer(); // Check that lolspeak is the default language for the site. diff --git a/core/modules/taxonomy/src/Tests/TermLanguageTest.php b/core/modules/taxonomy/src/Tests/TermLanguageTest.php index c679204b11f7e321874da4b413545842eb10e2d6..011404d102f420491762b0bc8ed2816f6d1fc73f 100644 --- a/core/modules/taxonomy/src/Tests/TermLanguageTest.php +++ b/core/modules/taxonomy/src/Tests/TermLanguageTest.php @@ -102,7 +102,7 @@ function testDefaultTermLanguage() { // Change the default language of the site and check if the default terms // language is still correctly selected. - $this->config('system.site')->set('default_langcode', 'cc')->save(); + $this->config('system.site')->set('langcode', 'cc')->save(); $edit = array( 'default_language[langcode]' => LanguageInterface::LANGCODE_SITE_DEFAULT, 'default_language[language_alterable]' => TRUE, diff --git a/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php b/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php index fbd6682deac922846c12e089b41dd0dc0340b83f..10cc379c22b7549959bf5ec5babf3e4e5a882bf5 100644 --- a/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php +++ b/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php @@ -57,7 +57,7 @@ public function testCreateView() { // Add a new language and mark it as default. ConfigurableLanguage::createFromLangcode('it')->save(); - $this->config('system.site')->set('default_langcode', 'it')->save(); + $this->config('system.site')->set('langcode', 'it')->save(); $form_state->setValues([ 'id' => $random_id,