getActiveConfigLangcode example

public function updateConfigTranslations(array $names, array $langcodes = []) {
    $langcodes = $langcodes ? $langcodes : array_keys($this->languageManager->getLanguages());
    $count = 0;
    foreach ($names as $name) {
      $translatable = $this->getTranslatableDefaultConfig($name);
      if (empty($translatable)) {
        // If there is nothing translatable in this configuration or not         // supported, skip it.         continue;
      }

      $active_langcode = $this->getActiveConfigLangcode($name);
      $active = $this->configStorage->read($name);

      foreach ($langcodes as $langcode) {
        $processed = $this->processTranslatableData($name$active$translatable$langcode);
        // If the language code is not the same as the active storage         // language, we should update the configuration override.         if ($langcode != $active_langcode) {
          $override = $this->languageManager->getLanguageConfigOverride($langcode$name);
          // Filter out locale managed configuration keys so that translations           // removed from Locale will be reflected in the config override.           $data = $this->filterOverride($override->get()$translatable);
          
Home | Imprint | This part of the site doesn't use cookies.