Skip to content

Commit

Permalink
Change locale key name
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanmola committed Oct 9, 2023
1 parent fea1a82 commit c4b6928
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion webApp/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const hex_hmac_signature = import.meta.env.VITE_HEX_HMAC_SIGNATURE;
// Try to retrieve the saved `locale` from LocalStorage if available
const locale = localStorage.getItem('locale');
const locale = localStorage.getItem('simplist_locale');
</script>
<template>
Expand Down
2 changes: 1 addition & 1 deletion webApp/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const i18nLocale = useI18n({ useScope: 'global' });
// Set i18n locale based on the user's locale provided by <LocaleProvider>
i18nLocale.locale.value = localStorage.getItem('locale') || inject('locale', 'en');
i18nLocale.locale.value = localStorage.getItem('simplist_locale') || inject('locale', 'en');
// Define a reactive empty object that holds tasks
const tasks = ref({});
Expand Down
4 changes: 2 additions & 2 deletions webApp/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import { List, Section, RadioButton } from '@erfanmola/televue';
const i18nLocale = useI18n({ useScope: 'global' });
const locale = ref(localStorage.getItem('locale') || inject('locale', 'en'));
const locale = ref(localStorage.getItem('simplist_locale') || inject('locale', 'en'));
// Set i18n locale
i18nLocale.locale.value = locale.value;
watch(locale, () => {
localStorage.setItem('locale', locale.value);
localStorage.setItem('simplist_locale', locale.value);
window.location.reload();
});
Expand Down

0 comments on commit c4b6928

Please sign in to comment.