ui(i18n): translate select language (#204)

This commit is contained in:
Chris 2022-11-29 00:28:44 +08:00 committed by GitHub
parent 4e73bba5cd
commit f72dd01ce7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View file

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { STORAGE_KEY_LANG } from '~/constants'
const { locale } = useI18n()
const { locale, t } = useI18n()
useLocalStorage(STORAGE_KEY_LANG, locale)
// TODO: read from $i18n https://i18n.nuxtjs.org/lang-switcher
@ -18,7 +18,7 @@ const languageList = [
</script>
<template>
<CommonTooltip placement="bottom" content="Select Language">
<CommonTooltip placement="bottom" :content="t('selectLanguage')">
<CommonDropdown>
<button flex>
<div i-ri:earth-line text-lg />

View file

@ -1,4 +1,5 @@
{
"selectLanguage": "Select Language",
"nav_side": {
"home": "Home",
"notifications": "Notifications",

View file

@ -1,4 +1,5 @@
{
"selectLanguage": "选择语言",
"nav_side": {
"bookmarks": "书签",
"conversations": "私信",