summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2015-03-25 16:13:13 +0000
committerNathaniel Catchpole2015-03-25 16:13:13 +0000
commit079a52b45df32b8aa82d1eb0c57bd97d1e065f57 (patch)
tree42fa4da98dfdc120e504b51bd462a9010d7088ec
parent92ee8c54f106762103eec3ece0b07451fc7abe5a (diff)
Revert "Issue #2457653 by Gábor Hojtsy: System.site langcode is both used as a file language code and a site language code"8.0.0-beta9
This reverts commit 364a6e9cc1b7d4a7ac70457314a9ade32a66d2de.
-rw-r--r--core/includes/install.core.inc5
-rw-r--r--core/includes/install.inc1
-rw-r--r--core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php2
-rw-r--r--core/modules/ckeditor/src/Tests/CKEditorTest.php2
-rw-r--r--core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php2
-rw-r--r--core/modules/language/src/EventSubscriber/ConfigSubscriber.php4
-rw-r--r--core/modules/language/src/LanguageListBuilder.php2
-rw-r--r--core/modules/language/src/LanguageServiceProvider.php2
-rw-r--r--core/modules/language/src/Tests/LanguageConfigurationElementTest.php2
-rw-r--r--core/modules/language/src/Tests/LanguageDependencyInjectionTest.php4
-rw-r--r--core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php4
-rw-r--r--core/modules/locale/src/Tests/LocaleLocaleLookupTest.php2
-rw-r--r--core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php2
-rw-r--r--core/modules/menu_ui/src/Tests/MenuLanguageTest.php2
-rw-r--r--core/modules/system/config/install/system.site.yml1
-rw-r--r--core/modules/system/config/schema/system.schema.yml5
-rw-r--r--core/modules/system/src/Tests/Common/FormatDateTest.php2
-rw-r--r--core/modules/system/src/Tests/Theme/TwigTransTest.php2
-rw-r--r--core/modules/taxonomy/src/Tests/TermLanguageTest.php2
-rw-r--r--core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php2
20 files changed, 21 insertions, 29 deletions
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index a6e918f..52cca49 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 61d286b..e247378 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 5790294..44c14f1 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 @@ class BasicAuthTest extends WebTestBase {
*/
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 279b56f..ab303b6 100644
--- a/core/modules/ckeditor/src/Tests/CKEditorTest.php
+++ b/core/modules/ckeditor/src/Tests/CKEditorTest.php
@@ -406,7 +406,7 @@ class CKEditorTest extends KernelTestBase {
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 f21c30c..9ecf5ae 100644
--- a/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php
+++ b/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php
@@ -75,7 +75,7 @@ class ConfigLanguageOverrideWebTest extends WebTestBase {
// 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 ef3f65d..2b1c73c 100644
--- a/core/modules/language/src/EventSubscriber/ConfigSubscriber.php
+++ b/core/modules/language/src/EventSubscriber/ConfigSubscriber.php
@@ -54,8 +54,8 @@ class ConfigSubscriber implements EventSubscriberInterface {
*/
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 aa018dc..b8f6454 100644
--- a/core/modules/language/src/LanguageListBuilder.php
+++ b/core/modules/language/src/LanguageListBuilder.php
@@ -152,7 +152,7 @@ class LanguageListBuilder extends DraggableListBuilder {
// 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 de2fa6f..d7c4ddd 100644
--- a/core/modules/language/src/LanguageServiceProvider.php
+++ b/core/modules/language/src/LanguageServiceProvider.php
@@ -97,7 +97,7 @@ class LanguageServiceProvider extends ServiceProviderBase {
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 1d4ee27..f4e1378 100644
--- a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php
+++ b/core/modules/language/src/Tests/LanguageConfigurationElementTest.php
@@ -116,7 +116,7 @@ class LanguageConfigurationElementTest extends WebTestBase {
$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 46b3041..1a7a815 100644
--- a/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
+++ b/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
@@ -43,7 +43,7 @@ class LanguageDependencyInjectionTest extends LanguageTestBase {
$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 @@ class LanguageDependencyInjectionTest extends LanguageTestBase {
}
// 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 99d4778..f801b6a 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -93,7 +93,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
// 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 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
// 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 ef53b8c..0522010 100644
--- a/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php
+++ b/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php
@@ -32,7 +32,7 @@ class LocaleLocaleLookupTest extends WebTestBase {
// 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 a5786b1..f94db02 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 085722f..59b0458 100644
--- a/core/modules/menu_ui/src/Tests/MenuLanguageTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuLanguageTest.php
@@ -155,7 +155,7 @@ class MenuLanguageTest extends MenuWebTestBase {
// 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 403e464..10e2be2 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 ba8fa15..6888a56 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 9d9a265..63576fe 100644
--- a/core/modules/system/src/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/src/Tests/Common/FormatDateTest.php
@@ -96,7 +96,7 @@ class FormatDateTest extends WebTestBase {
$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 85ba19a..7f21b2d 100644
--- a/core/modules/system/src/Tests/Theme/TwigTransTest.php
+++ b/core/modules/system/src/Tests/Theme/TwigTransTest.php
@@ -70,7 +70,7 @@ class TwigTransTest extends WebTestBase {
$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 c679204..011404d 100644
--- a/core/modules/taxonomy/src/Tests/TermLanguageTest.php
+++ b/core/modules/taxonomy/src/Tests/TermLanguageTest.php
@@ -102,7 +102,7 @@ class TermLanguageTest extends TaxonomyTestBase {
// 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 fbd6682..10cc379 100644
--- a/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
+++ b/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
@@ -57,7 +57,7 @@ class WizardPluginBaseUnitTest extends ViewUnitTestBase {
// 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,