Browse Source

fix: initial value

- update: sort langs by value
pull/1397/head
tetuaoro 7 months ago
committed by Bernd Storath
parent
commit
ab570babf6
  1. 2
      src/app/components/ui/ChooseLang.vue
  2. 6
      src/app/pages/setup.vue

2
src/app/components/ui/ChooseLang.vue

@ -44,5 +44,5 @@ watch(langProxy, (newVal) => {
updateLang('update:lang', newVal);
});
const langs = LOCALES;
const langs = LOCALES.sort((a, b) => a.value.localeCompare(b.value));
</script>

6
src/app/pages/setup.vue

@ -102,7 +102,7 @@
<script setup lang="ts">
import { FetchError } from 'ofetch';
const { t, setLocale } = useI18n();
const { t, locale, setLocale } = useI18n();
const authStore = useAuthStore();
const globalStore = useGlobalStore();
@ -111,7 +111,7 @@ type SetupError = {
message: string;
};
const lang = ref('en'); // default
const lang = ref(locale.value);
const username = ref<null | string>(null);
const password = ref<null | string>(null);
@ -132,7 +132,7 @@ watch(setupError, (value) => {
function updateLang(value: string) {
lang.value = value;
// TODO: if the translation does not exist, it shows the key
// TODO: if the translation does not exist, it shows the key instead of default (en)
setLocale(lang.value);
}

Loading…
Cancel
Save