Skip to content

Commit 85fb99c

Browse files
committed
fallback language lookup to browser preferred language
1 parent f0b88b9 commit 85fb99c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/unit/const.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ export const getParam = param => {
8888

8989
export const lan = (() => {
9090
let l = getParam('lan').toLowerCase()
91+
if (!l && navigator.languages) {
92+
l = navigator.languages.find(l => i18nJSON.lan.indexOf(l) !== -1)
93+
}
9194
l = i18nJSON.lan.indexOf(l) === -1 ? i18nJSON.default : l
9295
return l
9396
})()

0 commit comments

Comments
 (0)