LocaleConfigSubscriber

Updates strings translation when configuration translations change.

This reacts to the updates of translated active configuration and configuration language overrides. When those updates involve configuration which was available as default configuration, we need to feed back changes to any item which was originally part of that configuration to the interface translation storage. Those updated translations are saved as customized, so further community translation updates will not undo user changes.

This subscriber does not respond to deleting active configuration or deleting configuration translations. The locale storage is additive and we cannot be sure that only a given configuration translation used a source string. So we should not remove the translations from locale storage in these cases. The configuration or override would itself be deleted either way.

By design locale module only deals with sources in English.

Hierarchy

See also

\Drupal\locale\LocaleConfigManager

File

core/modules/locale/src/LocaleConfigSubscriber.php, line 33

Namespace

Drupal\locale

Members

Name Modifiers Type Description
LocaleConfigSubscriber::$configFactory protected property The configuration factory.
LocaleConfigSubscriber::$localeConfigManager protected property The typed configuration manager.
LocaleConfigSubscriber::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface::getSubscribedEvents
LocaleConfigSubscriber::onConfigSave public function Updates the locale strings when a translated active configuration is saved.
LocaleConfigSubscriber::onOverrideChange public function Updates the locale strings when a configuration override is saved/deleted.
LocaleConfigSubscriber::processTranslatableData protected function Process the translatable data array with a given language.
LocaleConfigSubscriber::resetExistingTranslations protected function Reset existing locale translations to their source values.
LocaleConfigSubscriber::saveCustomizedTranslation protected function Saves a translation string and marks it as customized.
LocaleConfigSubscriber::updateLocaleStorage protected function Update locale storage based on configuration translations.
LocaleConfigSubscriber::__construct public function Constructs a LocaleConfigSubscriber.
doc_Drupal
2016-10-29 09:23:56
Comments
Leave a Comment

Please login to continue.