import { createApp } from "vue";
import router from "./router";
import App from "./App.vue";
import { vuetify } from "./plugins/vuetify";
import { pinia } from "./plugins/pinia";
import { createI18n } from "vue-i18n";
import zh from "./language/zh.json";
import en from "./language/en.json";

const i18n = createI18n({
  legacy: false,
  locale: localStorage.getItem("lang") ?? "zh",
  fallbackLocale: "zh",
  globalInjection: true,
  messages: {
    "zh": zh,
    "en": en,
  }
});

const app = createApp(App);

app.use(pinia);
app.use(router);
app.use(vuetify);
app.use(i18n);

app.mount("#app");
