Skip to content

Commit

Permalink
Merge pull request #203 from SELab-2/lang-selector-fix
Browse files Browse the repository at this point in the history
Fixed language selector local storage
  • Loading branch information
francisvaut authored Mar 31, 2024
2 parents a18c167 + b7aabeb commit e1619ff
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions frontend/src/components/LanguageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ const localeStorage = useLocalStorage('locale', locale.value);
*
* @param locale
*/
function updateLocale(locale: Ref<string>) {
function updateLocale(locale: string) {
// Update saved locale
localeStorage.value = locale.value;
localeStorage.value = locale;
// Update PrimeVue locale
config.locale = messages.value[locale.value]['primevue'] as PrimeVueLocaleOptions;
config.locale = messages.value[locale]['primevue'] as PrimeVueLocaleOptions;
}
/**
Expand All @@ -40,7 +39,7 @@ function getFlag(locale: string) {
/* Hooks */
onMounted(() => {
updateLocale(locale);
updateLocale(locale.value);
});
</script>

Expand Down

0 comments on commit e1619ff

Please sign in to comment.