diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 357aaf8..5208d68 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -669,8 +669,9 @@ function locale_config_update_multiple(array $names, array $langcodes = array()) else { // Do not bother deleting language overrides which do not exist in the // first place. - if (!$language_manager->getLanguageConfigOverride($langcode, $name)->isNew()) { - $locale_config_manager->deleteTranslationData($name, $langcode); + $override = $language_manager->getLanguageConfigOverride($langcode, $name); + if (!$override->isNew()) { + $override->delete(); } } } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 971b47d..2ceb0fb 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -411,8 +411,6 @@ function locale_system_remove($components) { if ($language_list = locale_translatable_language_list()) { module_load_include('compare.inc', 'locale'); \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc'); - // Delete configuration translations. - \Drupal\locale\Locale::config()->deleteComponentTranslations($components, array_keys($language_list)); // Only when projects are removed, the translation files and records will be // deleted. Not each disabled module will remove a project, e.g., sub diff --git a/core/modules/locale/src/LocaleConfigManager.php b/core/modules/locale/src/LocaleConfigManager.php index aee2d59..d66fc44 100644 --- a/core/modules/locale/src/LocaleConfigManager.php +++ b/core/modules/locale/src/LocaleConfigManager.php @@ -169,20 +169,6 @@ public function saveTranslationData($name, $langcode, array $data) { } /** - * Deletes translated configuration data. - * - * @param string $name - * Configuration object name. - * @param string $langcode - * Language code. - */ - public function deleteTranslationData($name, $langcode) { - $this->isUpdating = TRUE; - $this->languageManager->getLanguageConfigOverride($langcode, $name)->delete(); - $this->isUpdating = FALSE; - } - - /** * Gets configuration names associated with components. * * @param array $components @@ -209,27 +195,6 @@ public function getComponentNames(array $components) { } /** - * Deletes configuration translations for uninstalled components. - * - * @param array $components - * Array with string identifiers. - * @param array $langcodes - * Array of language codes. - */ - public function deleteComponentTranslations(array $components, array $langcodes) { - $this->isUpdating = TRUE; - $names = $this->getComponentNames($components); - if ($names && $langcodes) { - foreach ($names as $name) { - foreach ($langcodes as $langcode) { - $this->deleteTranslationData($name, $langcode); - } - } - } - $this->isUpdating = FALSE; - } - - /** * Gets configuration names associated with strings. * * @param array $lids diff --git a/core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php b/core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php index f3f7415..078d597 100644 --- a/core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php +++ b/core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php @@ -128,24 +128,10 @@ public function testDeleteTranslation() { $this->setUpTranslation($config_name, 'test', 'English test', 'German test'); $this->deleteLanguageOverride($config_name, 'test', 'English test'); - // Instead of deleting the translation, we need to keep a translation with - // the source value and mark it as customized to prevent the deletion being - // reverted by importing community translations. $this->assertTranslation($config_name, 'English test'); } /** - * Tests deleting community translations of shipped configuration. - */ - public function testLocaleDeleteTranslation() { - $config_name = 'locale_test.translation'; - - $this->setUpTranslation($config_name, 'test', 'English test', 'German test'); - $this->deleteLocaleTranslationData($config_name, 'test', 'English test'); - $this->assertNoTranslation($config_name, 'English test', FALSE); - } - - /** * Sets up a configuration string without a translation. * * The actual configuration is already available by installing locale_test