- Converting all to Typescript

- Installing 1.0.0.beta Quasar Upgrade
   - (Part 1 - Upgrade Components)
This commit is contained in:
Paolo Arena
2019-03-11 19:21:10 +01:00
parent bb3be0ec16
commit 74ecc4f278
46 changed files with 5986 additions and 0 deletions

45
src/boot/vue-i18n.ts Normal file
View File

@@ -0,0 +1,45 @@
// src/boot/vue-i18n.js
import VueI18n from 'vue-i18n'
import messages from '../statics/i18n'
import { tools } from '../store/Modules/tools'
export default ({ app, store, Vue }) => {
Vue.use(VueI18n)
// Vue.config.lang = process.env.LANG_DEFAULT;
let mylang = tools.getItemLS(tools.localStorage.lang)
if ((navigator) && (mylang === '')) {
mylang = navigator.language
// console.log(`LANG NAVIGATOR ${mylang}`)
}
if (mylang === '')
mylang = process.env.LANG_DEFAULT;
if (mylang.toLowerCase() === 'es-es')
mylang = 'es'
// console.log('MYLANG2=', mylang)
// console.log('process.env.LANG_DEFAULT=', process.env.LANG_DEFAULT)
Vue.config.lang = mylang
// import(`quasar/lang/${mylang}`).then(lang => {
// console.log(' ... LANGDEFAULT=', lang)
// this.$q.i18n.set(lang.default)
// import(`src/statics/i18n`).then(function () {
// })
// })
// console.log("PLUGINS INIT....");
// console.log("LANG_DEFAULT: ")
// console.log(process.env.LANG_DEFAULT)
// Set i18n instance on app
app.i18n = new VueI18n({
fallbackLocale: mylang,
locale: mylang,
messages
})
}