You are here

public function LocaleConfigSubscriber::updateLocaleStorage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/locale/src/LocaleConfigSubscriber.php \Drupal\locale\LocaleConfigSubscriber::updateLocaleStorage()
  2. 9 core/modules/locale/src/LocaleConfigSubscriber.php \Drupal\locale\LocaleConfigSubscriber::updateLocaleStorage()

Update locale storage based on configuration translations.

Parameters

\Drupal\Core\Config\StorableConfigBase $config: Active configuration or configuration translation override.

string $langcode: The language code of $config.

array $reference_config: (Optional) Reference configuration to check against if $config was an override. This allows us to update locale keys for data not in the override but still in the active configuration.

File

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

Class

LocaleConfigSubscriber
Updates strings translation when configuration translations change.

Namespace

Drupal\locale

Code

public function updateLocaleStorage(StorableConfigBase $config, $langcode, array $reference_config = []) {
  $name = $config
    ->getName();
  if ($this->localeConfigManager
    ->isSupported($name) && locale_is_translatable($langcode)) {
    $translatables = $this->localeConfigManager
      ->getTranslatableDefaultConfig($name);
    $this
      ->processTranslatableData($name, $config
      ->get(), $translatables, $langcode, $reference_config);
  }
}