Add sth like Config::get($name, $language)

Created on 24 October 2025, 8 days ago

Problem/Motivation

Coming from #3446084-26: EntityTypeBundleInfo static caching is not language aware .
There is no method to get a config item for a specific language.
The core-blessed hack is to globally ::setConfigOverrideLanguage, and change it back. Which is cumbersome and error-prone.

From ConfigurableLanguageManager::getNativeLanguages

  public function getNativeLanguages() {
    $languages = $this->getLanguages(LanguageInterface::STATE_CONFIGURABLE);
    $natives = [];

    $original_language = $this->getConfigOverrideLanguage();

    foreach ($languages as $langcode => $language) {
      $this->setConfigOverrideLanguage($language);
      $natives[$langcode] = ConfigurableLanguage::load($langcode);
    }
    $this->setConfigOverrideLanguage($original_language);
    Language::sort($natives);
    return $natives;
  }

Proposed resolution

Add sth like Config::get($name, $language)

Remaining tasks

Bikeshed where the method should live, do it.

User interface changes

None.

Introduced terminology

None.

API changes

New method.

Data model changes

None.

Release notes snippet

New method to get config for a languege.

📌 Task
Status

Active

Version

11.0 🔥

Component

configuration system

Created by

🇩🇪Germany geek-merlin Freiburg, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024