Use window.navigator.language before interface i18n language
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
smitten 2023-10-30 18:54:07 -04:00
parent 52b0b6f008
commit c9dc8f00f9
Signed by untrusted user: 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('_', '-')