Constant for undeterminded language

This commit is contained in:
Michael 2024-01-15 06:20:49 +00:00
parent 7a13d8b8ac
commit 9075d7f37d
5 changed files with 11 additions and 7 deletions

View file

@ -65,6 +65,9 @@ class L10n
'zh-cn' => '简体中文',
];
/** @var string Undetermined language */
const UNDETERMINED_LANGUAGE = 'un';
/**
* A string indicating the current language used for translation:
* - Two-letter ISO 639-1 code.
@ -438,7 +441,7 @@ class L10n
// In ISO 639-2 undetermined languages have got the code "und".
// There is no official code for ISO 639-1, but "un" is not assigned to any language.
$languages = ['un' => $this->t('Undetermined')];
$languages = [self::UNDETERMINED_LANGUAGE => $this->t('Undetermined')];
foreach ($this->getDetectableLanguages() as $code) {
$code = $this->toISO6391($code);