diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php index 589c555..81c4e58 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php @@ -238,6 +238,52 @@ class LocaleImportFunctionalTest extends WebTestBase { } /** + * Test automatic import of a module's translation files without English + * being enabled. + */ + function testAutomaticModuleTranslationImportGermanOnly() { + // Manually set the code for the language to match the test translation file. + $langcode = 'de'; + // Set the English name for the language. + $name = $this->randomName(16); + + // Add German as new language. + $edit = array( + 'predefined_langcode' => 'de', + 'langcode' => '', + 'name' => '', + 'direction' => '0', + ); + $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language')); + $this->assertText(t('German'), t('German is added.')); + + // Make German the default language. + $edit = array( + 'site_default' => 'de', + ); + $this->drupalPost('admin/config/regional/language', $edit, t('Save configuration')); + + // Delete the English language. + language_delete('en'); + /* + $edit = array(); + $this->drupalPost('en/admin/config/regional/language/delete/en', $edit, t('Delete')); + $this->assertNoText(t('English'), 'English is deleted.'); +*/ + // Reset statically cached language objects. + language(NULL, TRUE); + // Check the UI language. + drupal_language_initialize(); + + // Enable the book module. + $this->drupalGet('admin/modules'); + $edit['modules[Core][book][enable]'] = TRUE; + $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->assertText(t('The translation was successfully imported.'), t('The translation was successfully imported.')); + + } + + /** * Test msgctxt context support. */ function testLanguageContext() {