Use window.navigator.language before interface i18n language

This commit is contained in:
smitten 2023-10-30 18:54:07 -04:00
parent 52b0b6f008
commit c9dc8f00f9
No known key found for this signature in database
GPG key ID: 1DDD22F13552A07A

View file

@ -8,7 +8,7 @@ const specialLanguageCodes = {
'zh': 'zh-Hans'
}
const internalToBrowserLocale = code => specialLanguageCodes[code] || code
const internalToBrowserLocale = fallbackCode => specialLanguageCodes[fallbackCode] || window.navigator.language || fallbackCode
const internalToBackendLocale = code => internalToBrowserLocale(code).replace('_', '-')