feat: install and configure i18n features (#177)
Co-authored-by: Shinigami <chrissi92@hotmail.de> Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe> Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
443bd65c05
commit
871076f2d9
9 changed files with 170 additions and 16 deletions
36
components/nav/SelectLanguage.vue
Normal file
36
components/nav/SelectLanguage.vue
Normal file
|
@ -0,0 +1,36 @@
|
|||
<script lang="ts" setup>
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { locale } = useI18n()
|
||||
const languageList = [
|
||||
{
|
||||
value: 'en-US',
|
||||
label: 'English',
|
||||
},
|
||||
{
|
||||
value: 'zh-CN',
|
||||
label: '简体中文',
|
||||
},
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<CommonTooltip placement="bottom" content="Select Language">
|
||||
<CommonDropdown>
|
||||
<button align-top>
|
||||
<div i-ri:earth-line text-lg />
|
||||
</button>
|
||||
|
||||
<template #popper>
|
||||
<CommonDropdownItem
|
||||
v-for="item in languageList"
|
||||
:key="item.value"
|
||||
:checked="item.value === locale"
|
||||
@click="locale = item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</CommonDropdownItem>
|
||||
</template>
|
||||
</CommonDropdown>
|
||||
</CommonTooltip>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue