diff --git a/core/modules/system/src/Tests/Installer/InstallerTranslationMultipleLanguageTest.php b/core/modules/system/src/Tests/Installer/InstallerTranslationMultipleLanguageTest.php index a16369b..d97c695 100644 --- a/core/modules/system/src/Tests/Installer/InstallerTranslationMultipleLanguageTest.php +++ b/core/modules/system/src/Tests/Installer/InstallerTranslationMultipleLanguageTest.php @@ -53,6 +53,12 @@ protected function getPo($langcode) { msgid "Anonymous" msgstr "Anonymous $langcode" + +msgid "Language" +msgstr "Language $langcode" + +msgid "Manage user accounts, roles, and permissions." +msgstr "Manage user accounts, roles, and permissions. $langcode" ENDPO; } @@ -75,19 +81,7 @@ public function testTranslationsLoaded() { } // Verify the strings from the translation files were imported. - $test_samples = ['Save and continue', 'Anonymous']; - $langcodes = ['de', 'es']; - - foreach($test_samples as $sample) { - foreach($langcodes as $langcode) { - $edit = array(); - $edit['langcode'] = $langcode; - $edit['translation'] = 'translated'; - $edit['string'] = $sample; - $this->drupalPostForm('admin/config/regional/translate', $edit, t('Filter')); - $this->assertText($sample . ' ' . $langcode); - } - } + $this->verifyImportedStringsTranslated(); /** @var \Drupal\language\ConfigurableLanguageManager $language_manager */ $language_manager = \Drupal::languageManager(); @@ -127,6 +121,17 @@ public function testTranslationsLoaded() { $override_en = $language_manager->getLanguageConfigOverride('en', 'user.settings'); $this->assertEqual($override_en->get('anonymous'), 'Anonymous'); } + + // Activate a module, to make sure that config is not overriden by module + // installation. + $edit = array( + 'modules[Core][views][enable]' => TRUE, + 'modules[Core][filter][enable]' => TRUE, + ); + $this->drupalPostForm('admin/modules', $edit, t('Save configuration')); + + // Verify the strings from the translation are still as expected. + $this->verifyImportedStringsTranslated(); } else { // Active configuration should be English. @@ -140,6 +145,26 @@ public function testTranslationsLoaded() { // Spanish is always an override (never used as installation language). $this->assertEqual($override_es->get('anonymous'), 'Anonymous es'); + + } + + /** + * Helper function to verify that the expected strings are translated. + */ + protected function verifyImportedStringsTranslated() { + $test_samples = ['Save and continue', 'Anonymous', 'Language', 'Manage user accounts, roles, and permissions.']; + $langcodes = ['de', 'es']; + + foreach($test_samples as $sample) { + foreach($langcodes as $langcode) { + $edit = array(); + $edit['langcode'] = $langcode; + $edit['translation'] = 'translated'; + $edit['string'] = $sample; + $this->drupalPostForm('admin/config/regional/translate', $edit, t('Filter')); + $this->assertText($sample . ' ' . $langcode); + } + } } } diff --git a/core/profiles/testing_multilingual/testing_multilingual.info.yml b/core/profiles/testing_multilingual/testing_multilingual.info.yml index 3615e0b..b40e4cf 100644 --- a/core/profiles/testing_multilingual/testing_multilingual.info.yml +++ b/core/profiles/testing_multilingual/testing_multilingual.info.yml @@ -6,3 +6,4 @@ core: 8.x hidden: true dependencies: - locale + - tour