fix: problem that can not set correct locale if language is like en-US

This commit is contained in:
mzz2017 committed 2020-02-20 16:45:10 +08:00
1 parent 474b5909bc
commit 19ad577f57
2 files changed
+2 -4

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ code {
}
html{
@media screen and (max-width: 1024px) {
@media screen and (max-width: 1400px) {
font-size:0.9em;
@media screen and (max-width: 767px) {
font-size:0.8em;
+1 -3
View File
@@ -9,9 +9,7 @@ Vue.use(VueI18n);
// Create VueI18n instance with options
let locale = "zh";
for (let l of window.navigator.languages) {
if (l.toLowerCase() === "zh-cn") {
l = "zh";
}
l = l.split("-")[0];
if (l in messages) {
locale = l;
}