refactor(i18n): improve language handling and UI updates
- Enhanced language setting logic in App.vue and AppHeader.vue to support reactive updates without page reloads. - Updated language options in AppHeader.vue to use native labels for improved clarity. - Introduced a utility function in i18n/index.js to streamline locale updates, ensuring consistent language handling across the application.
This commit is contained in:
@@ -65,7 +65,13 @@ export default {
|
||||
MultiChatDialog,
|
||||
},
|
||||
created() {
|
||||
this.$i18n.locale = this.$store.getters.language;
|
||||
const code = this.$store.getters.language;
|
||||
const loc = this.$i18n.locale;
|
||||
if (loc && typeof loc === 'object' && 'value' in loc) {
|
||||
loc.value = code;
|
||||
} else {
|
||||
this.$i18n.locale = code;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user