mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-22 16:46:28 +01:00
More fallbacks for Intl.DisplayNames
This commit is contained in:
parent
bdb1dff278
commit
6c0f0a4127
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,10 @@ function _localeCode2Text(code) {
|
|||
try {
|
||||
const text = IntlDN(locale || i18n.locale).of(code);
|
||||
if (text !== code) return text;
|
||||
if (!fallback) {
|
||||
const anotherText = IntlDN(code).of(code);
|
||||
if (anotherText !== code) return anotherText;
|
||||
}
|
||||
return fallback || '';
|
||||
} catch (e) {
|
||||
if (codeMappings[code]) {
|
||||
|
|
Loading…
Reference in a new issue