Skip to content

Commit 9f504d3

Browse files
author
阿发
authored
Merge pull request #3 from matjaz/master
fallback language lookup to browser preferred language
2 parents f0b88b9 + 85fb99c commit 9f504d3

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)