diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php index 589c555..e7c9396 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php @@ -238,6 +238,46 @@ class LocaleImportFunctionalTest extends WebTestBase { } /** + * Test automatic import of a module's translation files without English + * being enabled. + */ + function testAutomaticModuleTranslationImportGermanOnly() { + // Code for the language - manually set to match the test translation file. + $langcode = 'de'; + // The English name for the language. + $name = $this->randomName(16); + + // Create a custom language. + $edit = array( + 'predefined_langcode' => 'de', + 'langcode' => '', + 'name' => '', + 'direction' => '0', + ); + $this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language')); + $this->assertText(t('German.'), t('German is added.')); + + // Make German the default. + $edit = array( + 'site_default' => 'de', + ); + $this->drupalPost('admin/config/regional/language', $edit, t('Save configuration')); + + // Delete English. + $edit = array( + 'site_default' => 'de', + ); + $this->drupalPost('admin/config/regional/language/delete/en', $edit, t('Delete')); + $this->assertNoText(t('English'), 'English is deleted.'); + + // Enable books module. + $edit['modules[Core][books][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() {