Use window.navigator.language before interface i18n language

This commit is contained in:
smitten 2023-10-30 18:54:07 -04:00
parent 1cf5ac4497
commit dda804a824
Signed by: smitten
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('_', '-')