cleanup i18n; wykrywanie języka

This commit is contained in:
2023-08-22 00:52:51 +02:00
parent c0552e890c
commit 4a1a840c16
5 changed files with 257 additions and 111 deletions
+1 -13
View File
@@ -1,23 +1,11 @@
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import { registerSW } from 'virtual:pwa-register';
import { createI18n } from 'vue-i18n';
import App from './App.vue';
import { LocaleMessageSchema, fetchBackendTranslations, locales } from './i18n';
import i18n from './i18n-setup';
const pinia = createPinia();
const i18n = createI18n<[LocaleMessageSchema], 'en' | 'pl'>({
locale: 'en',
fallbackLocale: 'pl',
legacy: false,
globalInjection: true,
messages: locales,
});
fetchBackendTranslations(i18n);
registerSW({
immediate: true,
});