Skip to content

Commit ce949ba

Browse files
committed
Switch i18n provider
1 parent ed5ebe9 commit ce949ba

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"vee-validate": "^2.1.0-beta.2",
88
"vue": "^2.5.7",
99
"vue-axios": "^2.1.1",
10+
"vue-i18n": "^8.6.0",
1011
"vue-router": "^3.0.1",
1112
"vuex": "^3.0.1",
12-
"vuex-i18n": "^1.10.5",
1313
"vuex-router-sync": "^5.0.0",
1414
"xterm": "^3.5.1"
1515
},
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
11
import Vue from 'vue';
22
import Vuex from 'vuex';
3-
import vuexI18n from 'vuex-i18n';
3+
import VueI18n from 'vue-i18n';
44
import VueRouter from 'vue-router';
55
import VeeValidate from 'vee-validate';
6-
7-
Vue.config.productionTip = false;
8-
require('./bootstrap');
9-
106
// Helpers
11-
import { Ziggy } from './helpers/ziggy';
7+
// @ts-ignore
8+
import {Ziggy} from './helpers/ziggy';
9+
// @ts-ignore
1210
import Locales from './../../../resources/lang/locales';
13-
import { flash } from './mixins/flash';
11+
12+
import {flash} from './mixins/flash';
1413
import store from './store/index';
1514
import router from './router';
1615

16+
Vue.config.productionTip = false;
17+
require('./bootstrap');
18+
19+
// @ts-ignore
1720
window.events = new Vue();
21+
// @ts-ignore
1822
window.Ziggy = Ziggy;
1923

2024
Vue.use(Vuex);
2125
Vue.use(VueRouter);
22-
Vue.use(vuexI18n.plugin, store);
2326
Vue.use(VeeValidate);
27+
Vue.use(VueI18n);
2428

2529
// $FlowFixMe: this is always going to be unhappy because we ignore the vendor dir.
2630
const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default;
2731

28-
Vue.mixin({ methods: { route }});
32+
Vue.mixin({methods: {route}});
2933
Vue.mixin(flash);
3034

31-
Vue.i18n.add('en', Locales.en);
32-
Vue.i18n.set('en');
35+
const i18n = new VueI18n({
36+
locale: 'en',
37+
messages: {...Locales},
38+
});
3339

3440
// $FlowFixMe
3541
if (module.hot) {
3642
module.hot.accept();
3743
}
3844

39-
new Vue({ store, router }).$mount('#pterodactyl');
45+
new Vue({store, router, i18n}).$mount('#pterodactyl');

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = {
7474
hints: false,
7575
},
7676
// Passing an array loads them all but only exports the last.
77-
entry: ['./resources/assets/styles/main.css', './resources/assets/scripts/app.js'],
77+
entry: ['./resources/assets/styles/main.css', './resources/assets/scripts/app.ts'],
7878
output: {
7979
path: path.resolve(__dirname, 'public/assets'),
8080
filename: 'bundle-[hash].js',

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7446,6 +7446,10 @@ vue-hot-reload-api@^2.2.0:
74467446
version "2.3.0"
74477447
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.0.tgz#97976142405d13d8efae154749e88c4e358cf926"
74487448

7449+
vue-i18n@^8.6.0:
7450+
version "8.6.0"
7451+
resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-8.6.0.tgz#63848b183cf6f100436bcdd84382416e43b07188"
7452+
74497453
vue-loader@^14.2.2:
74507454
version "14.2.3"
74517455
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-14.2.3.tgz#3b39645c322d956e287d8d36eb77475f78c9b8e0"
@@ -7504,10 +7508,6 @@ vueify-insert-css@^1.0.0:
75047508
version "1.0.0"
75057509
resolved "https://registry.yarnpkg.com/vueify-insert-css/-/vueify-insert-css-1.0.0.tgz#57e5d791907e8c9d87ae6de099a2174bd0a7f990"
75067510

7507-
vuex-i18n@^1.10.5:
7508-
version "1.10.5"
7509-
resolved "https://registry.yarnpkg.com/vuex-i18n/-/vuex-i18n-1.10.5.tgz#635ea2204e0aa3f8fd512f0fab7f6b994d3f666c"
7510-
75117511
vuex-router-sync@^5.0.0:
75127512
version "5.0.0"
75137513
resolved "https://registry.yarnpkg.com/vuex-router-sync/-/vuex-router-sync-5.0.0.tgz#1a225c17a1dd9e2f74af0a1b2c62072e9492b305"

0 commit comments

Comments
 (0)