function LocaleConfigManager::saveTranslationOverride

Same name in other branches
  1. 9 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::saveTranslationOverride()
  2. 8.9.x core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::saveTranslationOverride()
  3. 11.x core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::saveTranslationOverride()

Saves translated configuration override.

Parameters

string $name: Configuration object name.

string $langcode: Language code.

array $data: Configuration data to be saved, that will be only the translated values.

1 call to LocaleConfigManager::saveTranslationOverride()
LocaleConfigManager::updateConfigTranslations in core/modules/locale/src/LocaleConfigManager.php
Updates all configuration translations for the names / languages provided.

File

core/modules/locale/src/LocaleConfigManager.php, line 253

Class

LocaleConfigManager
Manages configuration supported in part by interface translation.

Namespace

Drupal\locale

Code

protected function saveTranslationOverride($name, $langcode, array $data) {
    $this->isUpdatingFromLocale = TRUE;
    $this->languageManager
        ->getLanguageConfigOverride($langcode, $name)
        ->setData($data)
        ->save();
    $this->isUpdatingFromLocale = FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.