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

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

djroshi created an issue. See original summary.

quietone’s picture

Version: 11.3.x-dev » main
Issue summary: View changes

Hi, 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.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.