mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 02:09:28 +08:00
add zh-tw
This commit is contained in:
@@ -24,6 +24,7 @@ const config: LinguiConfig = {
|
|||||||
"sv",
|
"sv",
|
||||||
"uk",
|
"uk",
|
||||||
"vi",
|
"vi",
|
||||||
|
"zh",
|
||||||
"zh-CN",
|
"zh-CN",
|
||||||
"zh-HK",
|
"zh-HK",
|
||||||
],
|
],
|
||||||
|
@@ -2,7 +2,7 @@ import { $direction } from "./stores"
|
|||||||
import { i18n } from "@lingui/core"
|
import { i18n } from "@lingui/core"
|
||||||
import type { Messages } from "@lingui/core"
|
import type { Messages } from "@lingui/core"
|
||||||
import languages from "@/lib/languages"
|
import languages from "@/lib/languages"
|
||||||
import { detect, fromUrl, fromStorage, fromNavigator } from "@lingui/detect-locale"
|
import { detect, fromStorage, fromNavigator } from "@lingui/detect-locale"
|
||||||
import { messages as enMessages } from "@/locales/en/en.ts"
|
import { messages as enMessages } from "@/locales/en/en.ts"
|
||||||
|
|
||||||
// let locale = detect(fromUrl("lang"), fromStorage("lang"), fromNavigator(), "en")
|
// let locale = detect(fromUrl("lang"), fromStorage("lang"), fromNavigator(), "en")
|
||||||
@@ -41,15 +41,10 @@ export async function dynamicActivate(locale: string) {
|
|||||||
if (locale?.startsWith("zh-")) {
|
if (locale?.startsWith("zh-")) {
|
||||||
// map zh variants to zh-CN
|
// map zh variants to zh-CN
|
||||||
const zhVariantMap: Record<string, string> = {
|
const zhVariantMap: Record<string, string> = {
|
||||||
"zh-CN": "zh-CN",
|
|
||||||
"zh-SG": "zh-CN",
|
|
||||||
"zh-MY": "zh-CN",
|
|
||||||
zh: "zh-CN",
|
|
||||||
"zh-Hans": "zh-CN",
|
|
||||||
"zh-HK": "zh-HK",
|
"zh-HK": "zh-HK",
|
||||||
"zh-TW": "zh-HK",
|
"zh-TW": "zh",
|
||||||
"zh-MO": "zh-HK",
|
"zh-MO": "zh",
|
||||||
"zh-Hant": "zh-HK",
|
"zh-Hant": "zh",
|
||||||
}
|
}
|
||||||
dynamicActivate(zhVariantMap[locale] || "zh-CN")
|
dynamicActivate(zhVariantMap[locale] || "zh-CN")
|
||||||
} else {
|
} else {
|
||||||
|
@@ -119,4 +119,9 @@ export default [
|
|||||||
label: "繁體中文",
|
label: "繁體中文",
|
||||||
e: "🇭🇰",
|
e: "🇭🇰",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
lang: "zh",
|
||||||
|
label: "繁體中文",
|
||||||
|
e: "🇹🇼",
|
||||||
|
},
|
||||||
] as const
|
] as const
|
||||||
|
@@ -829,4 +829,3 @@ msgstr "YAML 設定檔"
|
|||||||
#: src/components/routes/settings/layout.tsx:34
|
#: src/components/routes/settings/layout.tsx:34
|
||||||
msgid "Your user settings have been updated."
|
msgid "Your user settings have been updated."
|
||||||
msgstr "已更新您的使用者設定"
|
msgstr "已更新您的使用者設定"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user