Commit 1348de9d authored by tyyin lan's avatar tyyin lan

chore(多语言): 默认语言切换

parent 55d2c127
......@@ -6,7 +6,7 @@ import { Plus } from '@icon-park/vue-next'
import type { MenuOption } from 'naive-ui'
import CustomIcon from '@/components/custom-icon/custom-icon.vue'
import { useUserStore } from '@/store/modules/user'
import LanguageSetting from '@/components/language-setting/language-setting.vue'
// import LanguageSetting from '@/components/language-setting/language-setting.vue'
const { t } = useI18n()
......@@ -117,16 +117,18 @@ function handleMenuValueChange(key: string) {
</n-scrollbar>
</div>
<div class="mb-[20px] mt-6 px-[12px]">
<div class="mb-[20px] mt-6">
<div>
<NDropdown
v-if="userStore.isLogin"
trigger="click"
placement="top-start"
placement="top"
:options="avatarOptions"
@select="handleDropdownSelect"
>
<div class="flex h-full cursor-pointer items-center">
<div
class="flex h-full cursor-pointer items-center rounded-[6px] px-[12px] py-[4px] transition hover:bg-[#F3F3F5]"
>
<NAvatar round :size="40" object-fit="cover" :src="userStore.userInfo.avatarUrl || defaultAvatar" />
<div class="ml-3 line-clamp-1 max-w-[140px] select-none break-all text-base">
......@@ -142,9 +144,9 @@ function handleMenuValueChange(key: string) {
</div>
</div>
<div class="mt-[10px]">
<!-- <div class="mt-[10px]">
<LanguageSetting arrow-direction="top" />
</div>
</div> -->
</div>
</div>
</template>
......
......@@ -3,12 +3,12 @@ import { createI18n } from 'vue-i18n'
import messages from './messages'
import { ss } from '@/utils/storage'
export const defaultLocale = 'zh-CN'
export const defaultLocale = 'zh-HK'
const i18n = createI18n<[I18n.Schema], I18n.LangType>({
legacy: false,
locale: ss.get('i18nextLng') || defaultLocale,
fallbackLocale: 'zh-HK',
fallbackLocale: 'zh-CN',
messages,
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment