🚸 🐛 Fix HMR issues & change lang without reload
- Fix HMR issues due to circular import of "language" and "i18n" - Move i18n to seperate file - Dynamically update language instead of doing a full page reload
This commit is contained in:
11
src/main.js
11
src/main.js
@ -2,16 +2,7 @@ import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import router from "./router";
|
||||
import { registerSW } from "virtual:pwa-register";
|
||||
import { createI18n } from "vue-i18n";
|
||||
import { strings } from "./strings";
|
||||
import { language } from "./store";
|
||||
|
||||
const i18n = createI18n({
|
||||
locale: language.value,
|
||||
fallbackLocale: "en",
|
||||
messages: strings,
|
||||
});
|
||||
export default i18n;
|
||||
import i18n from "./i18n";
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
|
Reference in New Issue
Block a user