diff --git a/package-lock.json b/package-lock.json index eb84679d..1478a299 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1130,6 +1130,11 @@ "tinycolor2": "^1.1.2" } }, + "vue-i18n": { + "version": "8.28.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.28.2.tgz", + "integrity": "sha512-C5GZjs1tYlAqjwymaaCPDjCyGo10ajUphiwA922jKt9n7KPpqR7oM1PCwYzhB/E7+nT3wfdG3oRre5raIT1rKA==" + }, "vue-loader": { "version": "17.2.2", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-17.2.2.tgz", diff --git a/package.json b/package.json index 1b5a4392..2b5fb98e 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "axios": "^1.6.0", "lucide-vue": "^0.292.0", "vue-color": "^2.7.0", + "vue-i18n": "^8.28.2", "vue-router": "3" } } diff --git a/resources/assets/js/prototype/app.js b/resources/assets/js/prototype/app.js index 3202b580..c336c189 100644 --- a/resources/assets/js/prototype/app.js +++ b/resources/assets/js/prototype/app.js @@ -1,7 +1,10 @@ import ApexCharts from 'apexcharts'; import Vue from 'vue'; +import VueI18n from 'vue-i18n' import VueRouter from 'vue-router'; +import translations from './translations'; + import App from './components/App.vue'; import Login from './screens/Login.vue'; @@ -15,6 +18,8 @@ window.ApexCharts = ApexCharts; Vue.prototype.versionNumber = window.versionNumber; +Vue.use(VueI18n); + Vue.use(VueRouter); const routes = [ @@ -45,6 +50,11 @@ const routes = [ }, ]; +const i18n = new VueI18n({ + locale: 'en', + messages: translations, +}); + const router = new VueRouter({ mode: 'history', routes, @@ -52,6 +62,7 @@ const router = new VueRouter({ new Vue({ el: '#app', + i18n, router, render: h => h(App), }); diff --git a/resources/assets/js/prototype/components/App.vue b/resources/assets/js/prototype/components/App.vue index 8274faaa..4303ff2e 100644 --- a/resources/assets/js/prototype/components/App.vue +++ b/resources/assets/js/prototype/components/App.vue @@ -1,4 +1,17 @@