remove title casing of Intl.DisplayNames language names (#8433)
This commit is contained in:
@@ -45,8 +45,7 @@ function getLocalizedLanguage(
|
|||||||
const translatedName = allNames.of(langCode)
|
const translatedName = allNames.of(langCode)
|
||||||
|
|
||||||
if (translatedName) {
|
if (translatedName) {
|
||||||
// force simple title case (as languages do not always start with an uppercase in Unicode data)
|
return translatedName
|
||||||
return translatedName[0].toLocaleUpperCase() + translatedName.slice(1)
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// ignore RangeError from Intl.DisplayNames APIs
|
// ignore RangeError from Intl.DisplayNames APIs
|
||||||
|
|||||||
Reference in New Issue
Block a user