use/get a ConfigurableLanguageManager when later needing to call getLanguageConfigOverride()

Created on 13 October 2014, over 9 years ago
Updated 27 January 2023, over 1 year ago

Problem/Motivation

We have a pattern where we get a Language from languageManager() and then later call getLanguageConfigOverride(). But getLanguageConfigOverride() is only for ConfigurableLanguage (managers).

for example in
ConfigLanguageOverrideWebTest::testSiteNameTranslation()

   \Drupal::languageManager()
      ->getLanguageConfigOverride($langcode, 'system.site')
      ->set('name', 'XX site name')
      ->save();

(note maybe also added in #1879930: Language selectors are not showing localized to the page language → depending on how that goes in.)

Proposed resolution

use a configurable language manager when we need config things.

Remaining tasks

<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->

User interface changes

No.

API changes

No.

📌 Task
Status

Needs work

Version

10.1 ✨

Component
Language system  →

Last updated about 10 hours ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇺🇸United States YesCT

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

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.

Production build 0.69.0 2024