mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-19 09:51:35 +02:00
Move locales to single json files & Replace laravel-vue-i18n with vue-i18n
This commit is contained in:
18
resources/js/app.js
vendored
18
resources/js/app.js
vendored
@@ -1,5 +1,6 @@
|
||||
import '@2fauth/styles/src/app.scss';
|
||||
|
||||
import i18n from './i18n'
|
||||
import Notifications from '@kyvg/vue3-notification'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
@@ -20,27 +21,20 @@ const $2fauth = {
|
||||
}
|
||||
app.provide('2fauth', readonly($2fauth))
|
||||
|
||||
// Localization
|
||||
app.use(i18n)
|
||||
|
||||
// Stores
|
||||
const pinia = createPinia()
|
||||
pinia.use(({ store }) => {
|
||||
store.$2fauth = $2fauth;
|
||||
});
|
||||
store.$i18n = i18n
|
||||
})
|
||||
app.use(pinia)
|
||||
|
||||
// Router
|
||||
app.use(router)
|
||||
|
||||
// Localization
|
||||
app.use(i18nVue, {
|
||||
lang: document.documentElement.lang,
|
||||
resolve: async lang => {
|
||||
const langs = import.meta.glob('../lang/*.json');
|
||||
if (lang.includes('php_')) {
|
||||
return await langs[`../lang/${lang}.json`]();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Notifications
|
||||
app.use(Notifications)
|
||||
|
||||
|
Reference in New Issue
Block a user