Skip to content

Commit

Permalink
fix get language code
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhuai committed Aug 4, 2019
1 parent 09cd6c2 commit 5f959bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/AboutPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
},
computed: {
currentLocale() {
return window.navigator.languages[0];
return chrome.i18n.getUILanguage();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import store from './store';
import moment from 'moment';

Vue.config.productionTip = false;
const locale = window.navigator.languages[0];
moment.locale(locale);
moment.locale(chrome.i18n.getUILanguage());

Vue.prototype.$tr = (name) => chrome.i18n.getMessage(name);
Vue.prototype.$moment = moment;
Expand Down

0 comments on commit 5f959bf

Please sign in to comment.