refactor(i18n): move locale updater to language switch button

This commit is contained in:
2026-08-07 02:10:12 +02:00
parent e964c2635f
commit 31588b2f1c
2 changed files with 5 additions and 5 deletions
@@ -19,12 +19,12 @@ import Icon from '@/features/icons/components/Icon.vue';
import { LANGUAGE_PATH } from '@/config/featureSettings';
import { useSettings } from '@/features/settings/composables/useSettings';
import { ref } from 'vue';
import { ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { SUPPORTED_LANGUAGES } from '@/i18n';
import { setLocale, SUPPORTED_LANGUAGES } from '@/i18n';
const { t, locale } = useI18n();
const { setSetting } = useSettings();
const { setSetting, getSetting } = useSettings();
const isOpen = ref(false);
const languageDropdown = ref(null);
@@ -34,6 +34,8 @@ const selectLanguage = function selectLanguage (code) {
close();
};
watch(() => getSetting(LANGUAGE_PATH), setLocale);
const close = function () {
document.removeEventListener('click', closeWrapperOnClickOutsite);
isOpen.value = false;