Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LocaleConfigSubscriber.php

function 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.

2 calls to LocaleConfigSubscriber::updateLocaleStorage()
LocaleConfigSubscriber::onConfigSave in core/modules/locale/src/LocaleConfigSubscriber.php
Updates the locale strings when a translated active configuration is saved.
LocaleConfigSubscriber::onOverrideChange in core/modules/locale/src/LocaleConfigSubscriber.php
Updates the locale strings when a configuration override is saved/deleted.

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);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal