mobilizon/js/src/main.ts
Thomas Citharel 96380f7df2
Move i18n to vue-i18n and json files
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-09-12 12:19:02 +02:00

37 lines
910 B
TypeScript

// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import Buefy from 'buefy';
import VueI18n from 'vue-i18n';
import App from '@/App.vue';
import router from '@/router';
import { apolloProvider } from './vue-apollo';
import { NotifierPlugin } from '@/plugins/notifier';
import filters from '@/filters';
import messages from '@/i18n/index';
Vue.config.productionTip = false;
Vue.use(Buefy);
Vue.use(NotifierPlugin);
Vue.use(filters);
const language = (window.navigator as any).userLanguage || window.navigator.language;
Vue.use(VueI18n);
const i18n = new VueI18n({
locale: language.replace('-', '_'), // set locale
messages, // set locale messages
});
/* eslint-disable no-new */
new Vue({
router,
apolloProvider,
el: '#app',
template: '<App/>',
components: { App },
i18n,
});