You are here

public function LocaleConfigManager::deleteLanguageTranslations in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::deleteLanguageTranslations()
  2. 10 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::deleteLanguageTranslations()

Deletes configuration for language.

Parameters

string $langcode: Language code to delete.

File

core/modules/locale/src/LocaleConfigManager.php, line 337

Class

LocaleConfigManager
Manages configuration supported in part by interface translation.

Namespace

Drupal\locale

Code

public function deleteLanguageTranslations($langcode) {
  $this->isUpdatingFromLocale = TRUE;
  $storage = $this->languageManager
    ->getLanguageConfigOverrideStorage($langcode);
  foreach ($storage
    ->listAll() as $name) {
    $this->languageManager
      ->getLanguageConfigOverride($langcode, $name)
      ->delete();
  }
  $this->isUpdatingFromLocale = FALSE;
}