From 15e599fe3c03d3e58d70e645cbbf10e56194f60b Mon Sep 17 00:00:00 2001 From: Spythere Date: Thu, 27 Nov 2025 21:31:03 +0100 Subject: [PATCH] chore: moved language button to sceneries table top bar --- public/images/icon-en.svg | 7 +++++ public/images/icon-pl.svg | 10 ++++--- src/App.vue | 13 +++------ src/components/App/AppHeader.vue | 39 ++------------------------- src/components/App/AppWelcomeCard.vue | 14 ++-------- src/locales/en.json | 1 + src/locales/pl.json | 1 + src/store/mainStore.ts | 11 ++++++++ src/views/StationsView.vue | 21 +++++++++++++++ 9 files changed, 54 insertions(+), 63 deletions(-) create mode 100644 public/images/icon-en.svg diff --git a/public/images/icon-en.svg b/public/images/icon-en.svg new file mode 100644 index 0000000..7991383 --- /dev/null +++ b/public/images/icon-en.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/images/icon-pl.svg b/public/images/icon-pl.svg index 95e673b..0fa5145 100644 --- a/public/images/icon-pl.svg +++ b/public/images/icon-pl.svg @@ -1,4 +1,6 @@ - - - - + + + + + + diff --git a/src/App.vue b/src/App.vue index c19a0cb..4d3eb1d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,7 +9,7 @@ - +
@@ -159,18 +159,11 @@ export default defineComponent({ this.apiStore.connectToAPI(); }, - changeLang(lang: string) { - this.$i18n.locale = lang; - this.store.currentLocale = lang; - - StorageManager.setStringValue('lang', lang); - }, - loadLang() { const storageLang = StorageManager.getStringValue('lang'); if (storageLang) { - this.changeLang(storageLang); + this.store.changeLocale(storageLang); return; } @@ -179,7 +172,7 @@ export default defineComponent({ const naviLanguage = window.navigator.language.toString(); if (!naviLanguage.startsWith('pl')) { - this.changeLang('en'); + this.store.changeLocale('en'); return; } }, diff --git a/src/components/App/AppHeader.vue b/src/components/App/AppHeader.vue index 291ee7b..eea548b 100644 --- a/src/components/App/AppHeader.vue +++ b/src/components/App/AppHeader.vue @@ -1,18 +1,6 @@