From ff33baf84534ccfbf13a5b533e9b014d320f34f8 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 23 Dec 2024 20:38:27 +0100 Subject: Restore more logic from main branch --- src-vue/src/main.ts | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'src-vue/src/main.ts') diff --git a/src-vue/src/main.ts b/src-vue/src/main.ts index c586a747..e50189a9 100644 --- a/src-vue/src/main.ts +++ b/src-vue/src/main.ts @@ -1,5 +1,15 @@ import { createApp } from 'vue' +import { createI18n } from "vue-i18n"; import App from './App.vue' +import ElementPlus from "element-plus"; +import * as ElementPlusIconsVue from '@element-plus/icons-vue' +import PlayView from "./views/PlayView.vue"; +import ChangelogView from "./views/ChangelogView.vue"; +import ModsView from "./views/ModsView.vue"; +import SettingsView from "./views/SettingsView.vue"; +import DeveloperView from "./views/DeveloperView.vue"; +import RepairView from "./views/RepairView.vue"; +import {createRouter, createWebHashHistory} from "vue-router"; import en from "./i18n/lang/en.json"; import fr from "./i18n/lang/fr.json"; import da from "./i18n/lang/da.json"; @@ -13,6 +23,43 @@ import zh_Hans from "./i18n/lang/zh_Hans.json"; const app = createApp(App); +// internationalization +export const i18n = createI18n({ + locale: 'en', + fallbackLocale: 'en', + messages: { + en, fr, da, de, es, pl, ru, it, zh_Hans + } +}); +app.use(i18n); + +// styles +import 'element-plus/theme-chalk/index.css'; +import './style.css' + +app.use(ElementPlus); + +// icons +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component); +} + +// style + +// routes +const routes = [ + { path: '/', name: 'Main', component: async () => PlayView}, + { path: '/changelog', name: 'Changelog', component: async () => ChangelogView}, + { path: '/mods', name: 'Mods', component: async () => ModsView}, + { path: '/settings', name: 'Settings', component: async () => SettingsView}, + { path: '/dev', name: 'Dev', component: async () => DeveloperView}, + { path: '/repair', name: 'Repair', component: async () => RepairView}, +]; +export const router = createRouter({ + history: createWebHashHistory(), + routes, // short for `routes: routes` +}); +app.use(router); app.mount('#app') -- cgit v1.2.3