diff --git a/package.json b/package.json index 8fc5b12..43f4219 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "pinia": "^3.0.4", "sass": "^1.87.0", "vue": "^3.3.11", + "vue-i18n": "11", "vue-router": "5.0.4" }, "devDependencies": { diff --git a/src/App.vue b/src/App.vue index 79d3f58..57477da 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,6 +40,26 @@ export default defineComponent({ (this.mainStore.filters as any)[key] = settingsObj[key]; }); } + }, + + loadLang() { + const storageLang = window.localStorage.getItem('language'); + + if (storageLang) { + this.mainStore.locale = storageLang; + this.$i18n.locale = storageLang; + return; + } + + if (!window.navigator.language) return; + + const naviLanguage = window.navigator.language.toString(); + + if (!naviLanguage.startsWith('pl')) { + this.mainStore.locale = 'en'; + this.$i18n.locale = 'en'; + return; + } } }, @@ -68,7 +88,6 @@ export default defineComponent({ grid-template-rows: auto 1fr; min-height: 100vh; - overflow-x: hidden; } main { diff --git a/src/components/Dropdown.vue b/src/components/Dropdown.vue index 656ea03..ad571cc 100644 --- a/src/components/Dropdown.vue +++ b/src/components/Dropdown.vue @@ -6,37 +6,29 @@