Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse committed Mar 1, 2025
1 parent a8be488 commit afe3eb0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src-vue/src/components/LanguageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@

<script lang="ts">
import { defineComponent } from 'vue';
import { useI18n } from 'vue-i18n';
import { load } from '@tauri-apps/plugin-store';
const persistentStore = await load('flight-core-settings.json', { autoSave: false });
export default defineComponent({
name: 'LanguageSelector',
setup() {
const { locale } = useI18n();
return { locale };
},
data: () => ({
value: '',
options: [
Expand Down Expand Up @@ -62,11 +67,11 @@ export default defineComponent({
}),
mounted: async function () {
const lang: string = await persistentStore.get('lang') as string;
this.value = lang;
this.locale = lang;
},
methods: {
async onChange(value: string) {
this.$root!.$i18n.locale = value;
this.locale = value;
persistentStore.set('lang', value);
await persistentStore.save();
}
Expand Down

0 comments on commit afe3eb0

Please sign in to comment.