public function LocaleConfigSubscriber::configLoad

Override configuration values with localized data.

Parameters

\Drupal\Core\Config\ConfigEvent $event: The Event to process.

File

drupal/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php, line 82
Contains \Drupal\locale\LocaleConfigSubscriber.

Class

LocaleConfigSubscriber
Locale Config helper

Namespace

Drupal\locale

Code

public function configLoad(ConfigEvent $event) {
  $context = $event
    ->getContext();
  if ($language = $context
    ->get('locale.language')) {
    $config = $event
      ->getConfig();
    $locale_name = $this
      ->getLocaleConfigName($config
      ->getName(), $language);

    // Check to see if the config storage has an appropriately named file
    // containing override data.
    if ($override = $event
      ->getConfig()
      ->getStorage()
      ->read($locale_name)) {
      $config
        ->setOverride($override);
    }
  }
}