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

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

View File

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

View File

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