public function LocaleConfigSubscriber::onOverrideChange in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/locale/src/LocaleConfigSubscriber.php \Drupal\locale\LocaleConfigSubscriber::onOverrideChange()
Updates the locale strings when a configuration override is saved/deleted.
Parameters
\Drupal\language\Config\LanguageConfigOverrideCrudEvent $event: The language configuration event.
File
- core/
modules/ locale/ src/ LocaleConfigSubscriber.php, line 98 - Contains \Drupal\locale\LocaleConfigSubscriber.
Class
- LocaleConfigSubscriber
- Updates strings translation when configuration translations change.
Namespace
Drupal\localeCode
public function onOverrideChange(LanguageConfigOverrideCrudEvent $event) {
// Only attempt to feed back configuration override changes to locale if
// the update itself was not initiated by locale data changes.
if (!drupal_installation_attempted() && !$this->localeConfigManager
->isUpdatingTranslationsFromLocale()) {
$translation_config = $event
->getLanguageConfigOverride();
$langcode = $translation_config
->getLangcode();
$reference_config = $this->configFactory
->getEditable($translation_config
->getName())
->get();
$this
->updateLocaleStorage($translation_config, $langcode, $reference_config);
}
}