Problem/Motivation
I have a Drupal 11.3 website which needs to default to a custom language (Te Reo Māori). The IANA register for this language is:
Type: language
Subtag: mi
Description: Maori
Added: 2005-10-16
I have noticed two issues when adding Māori as a custom language and setting it as default in 11.3.
1. The Drupal\Core\Language\Language object is nameless. This leads to things like admin dropdowns that have "Site's default language ()" (note the empty parentheses).
\Drupal::languageManager()->getDefaultLanguage(); returns the following:
Drupal\Core\Language\Language {
#name: ""
#id: "mi"
#direction: "ltr"
#weight: 1
#locked: false
}
2. The config entity for the added language has the wrong langcode:
uuid: xxxx
langcode: en
status: true
dependencies: { }
id: mi
label: Maori
direction: ltr
weight: 1
locked: false
Issue #1 persists even after changing the langcode from "en" to "mi" via a config import.
Steps to reproduce
These issues seem to be reliably reproducible on a clean install of Drupal 11.3.
1. Enable the language module
2. Add the custom language as described above
3. Set the custom language as default
Proposed resolution
I think the language config entity should have the correct langcode and Drupal\Core\Language\LanguageManager should be able to resolve the name instead of leaving it blank?
Thanks
Comments
Comment #2
quietone commentedHi, Issues for Drupal core should be targeted to the 'main' branch, our primary development branch. Changes are made on the main branch first, and are then back ported as needed according to the Core change policies. The version the problem was discovered on should be stated in the issue summary Problem/Motivation section. Thanks.
Comment #3
quietone commentedActually I think this is a duplicate of #3337864: Introduce a dedicated "Configuration default language" different from "Site default language".