Skip to content

Commit

Permalink
Remove changes to LanguageSelector since the locale is set somewhere …
Browse files Browse the repository at this point in the history
…else.
  • Loading branch information
Elweyn committed Mar 26, 2024
1 parent d61220e commit fe90407
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions presenter/src/components/language/LanguageSelector.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-select
v-model="selectedLocale"
v-model="$i18n.locale"
density="compact"
name="language"
:items="languages"
Expand All @@ -12,7 +12,6 @@
bg-color="transparent"
hide-details="auto"
flat
@update:model-value="updateLocale"
>
<template #selection="{ item }">
<span>{{ item.raw.locale.toUpperCase() }}</span>
Expand All @@ -30,25 +29,9 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { usePageContext } from '#context/usePageContext'
import i18n from '#plugins/i18n'
import { locales, localizedLocale } from '#root/locales'
import { localizedLocale } from '#root/locales'
const languages = ref(localizedLocale)
const pageContext = usePageContext()
if (pageContext.locale && locales.includes(pageContext.locale)) {
i18n.global.locale.value = pageContext.locale
}
const selectedLocale = ref(i18n.global.locale.value)
function updateLocale() {
if (locales.includes(selectedLocale.value)) {
i18n.global.locale.value = selectedLocale.value
}
}
</script>

<style lang="scss">
Expand Down

0 comments on commit fe90407

Please sign in to comment.