- Fix: choose language : added flags
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
// src/plugins/i18n.js
|
||||
import VueI18n from 'vue-i18n';
|
||||
import messages from 'src/statics/i18n';
|
||||
import { rescodes } from "../store/Modules/rescodes";
|
||||
|
||||
export default ({ app, store, Vue }) => {
|
||||
Vue.use(VueI18n);
|
||||
Vue.config.lang = process.env.LANG_DEFAULT;
|
||||
// Vue.config.lang = process.env.LANG_DEFAULT;
|
||||
let mylang = localStorage.getItem(rescodes.localStorage.lang)
|
||||
if (mylang === '')
|
||||
mylang = process.env.LANG_DEFAULT;
|
||||
Vue.config.lang = mylang
|
||||
|
||||
// console.log("PLUGINS INIT....");
|
||||
|
||||
@@ -13,8 +18,9 @@ export default ({ app, store, Vue }) => {
|
||||
|
||||
// Set i18n instance on app
|
||||
app.i18n = new VueI18n({
|
||||
locale: process.env.LANG_DEFAULT,
|
||||
fallbackLocale: process.env.LANG_DEFAULT,
|
||||
locale: mylang,
|
||||
fallbackLocale: mylang,
|
||||
messages
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user