Switch i18n provider
This commit is contained in:
parent
ed5ebe9155
commit
ce949ba920
4 changed files with 25 additions and 19 deletions
|
@ -1,39 +1,45 @@
|
|||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import vuexI18n from 'vuex-i18n';
|
||||
import VueI18n from 'vue-i18n';
|
||||
import VueRouter from 'vue-router';
|
||||
import VeeValidate from 'vee-validate';
|
||||
// Helpers
|
||||
// @ts-ignore
|
||||
import {Ziggy} from './helpers/ziggy';
|
||||
// @ts-ignore
|
||||
import Locales from './../../../resources/lang/locales';
|
||||
|
||||
import {flash} from './mixins/flash';
|
||||
import store from './store/index';
|
||||
import router from './router';
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
require('./bootstrap');
|
||||
|
||||
// Helpers
|
||||
import { Ziggy } from './helpers/ziggy';
|
||||
import Locales from './../../../resources/lang/locales';
|
||||
import { flash } from './mixins/flash';
|
||||
import store from './store/index';
|
||||
import router from './router';
|
||||
|
||||
// @ts-ignore
|
||||
window.events = new Vue();
|
||||
// @ts-ignore
|
||||
window.Ziggy = Ziggy;
|
||||
|
||||
Vue.use(Vuex);
|
||||
Vue.use(VueRouter);
|
||||
Vue.use(vuexI18n.plugin, store);
|
||||
Vue.use(VeeValidate);
|
||||
Vue.use(VueI18n);
|
||||
|
||||
// $FlowFixMe: this is always going to be unhappy because we ignore the vendor dir.
|
||||
const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default;
|
||||
|
||||
Vue.mixin({ methods: { route }});
|
||||
Vue.mixin({methods: {route}});
|
||||
Vue.mixin(flash);
|
||||
|
||||
Vue.i18n.add('en', Locales.en);
|
||||
Vue.i18n.set('en');
|
||||
const i18n = new VueI18n({
|
||||
locale: 'en',
|
||||
messages: {...Locales},
|
||||
});
|
||||
|
||||
// $FlowFixMe
|
||||
if (module.hot) {
|
||||
module.hot.accept();
|
||||
}
|
||||
|
||||
new Vue({ store, router }).$mount('#pterodactyl');
|
||||
new Vue({store, router, i18n}).$mount('#pterodactyl');
|
Loading…
Add table
Add a link
Reference in a new issue