i18n config

This commit is contained in:
Rafi
2023-02-14 21:24:33 +08:00
parent 233eb9c27a
commit 5abd5edba5
4 changed files with 48 additions and 16 deletions

29
app.vue
View File

@@ -13,6 +13,11 @@ const setTheme = (theme) => {
const feedback = () => {
window.open('https://github.com/WongSaang/chatgpt-ui/issues', '_blank')
}
const { locale, locales } = useI18n()
const setLang = (lang) => {
locale.value = lang
}
</script>
<template>
@@ -22,6 +27,7 @@ const feedback = () => {
<v-navigation-drawer
v-model="drawer"
>
{{ $t('hello') }}
<v-list>
<ModelDialog/>
</v-list>
@@ -54,6 +60,29 @@ const feedback = () => {
</v-list>
</v-menu>
<v-menu
>
<template v-slot:activator="{ props }">
<v-list-item
v-bind="props"
rounded="xl"
prepend-icon="language"
title="Language"
></v-list-item>
</template>
<v-list
bg-color="white"
>
<v-list-item
v-for="locale in locales"
:key="locale.code"
@click="setLang(locale.code)"
>
<v-list-item-title>{{ locale.name }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<v-list-item
rounded="xl"
prepend-icon="help_outline"