From bbd815ec679ae9cd73a321bacb95590e6f7c143b Mon Sep 17 00:00:00 2001 From: Ban921 <3637117+Ban921@users.noreply.github.com> Date: Wed, 27 May 2026 09:46:24 +0800 Subject: [PATCH] feat: add Traditional Chinese (zh-Hant) language option The zh-Hant translations are synced from Weblate (98% complete) but the locale was never registered in the language selector, so users could not select it. Register zh-Hant in supportedLanguageKeys, add its display label, and map it to the zh-TW date-fns locale. --- web/public/locales/en/common.json | 1 + web/src/components/menu/GeneralSettings.tsx | 1 + web/src/hooks/use-date-locale.ts | 2 ++ web/src/lib/const.ts | 1 + 4 files changed, 5 insertions(+) diff --git a/web/public/locales/en/common.json b/web/public/locales/en/common.json index 4436808d08..272e0f2795 100644 --- a/web/public/locales/en/common.json +++ b/web/public/locales/en/common.json @@ -177,6 +177,7 @@ "en": "English (English)", "es": "Español (Spanish)", "zhCN": "简体中文 (Simplified Chinese)", + "zhHant": "繁體中文 (Traditional Chinese)", "hi": "हिन्दी (Hindi)", "fr": "Français (French)", "ar": "العربية (Arabic)", diff --git a/web/src/components/menu/GeneralSettings.tsx b/web/src/components/menu/GeneralSettings.tsx index b3ab45f987..88d834d4dc 100644 --- a/web/src/components/menu/GeneralSettings.tsx +++ b/web/src/components/menu/GeneralSettings.tsx @@ -109,6 +109,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) { "nb-NO": "nb", "yue-Hant": "yue", "zh-CN": "zhCN", + "zh-Hant": "zhHant", "pt-BR": "ptBR", }; diff --git a/web/src/hooks/use-date-locale.ts b/web/src/hooks/use-date-locale.ts index 4feef686a4..9cd018c423 100644 --- a/web/src/hooks/use-date-locale.ts +++ b/web/src/hooks/use-date-locale.ts @@ -34,6 +34,8 @@ const localeMap: Record Promise> = { sk: () => import("date-fns/locale/sk").then((module) => module.sk), "yue-Hant": () => import("date-fns/locale/zh-HK").then((module) => module.zhHK), + "zh-Hant": () => + import("date-fns/locale/zh-TW").then((module) => module.zhTW), lt: () => import("date-fns/locale/lt").then((module) => module.lt), th: () => import("date-fns/locale/th").then((module) => module.th), ca: () => import("date-fns/locale/ca").then((module) => module.ca), diff --git a/web/src/lib/const.ts b/web/src/lib/const.ts index 5db13e375d..2802870201 100644 --- a/web/src/lib/const.ts +++ b/web/src/lib/const.ts @@ -29,6 +29,7 @@ export const supportedLanguageKeys = [ "nb-NO", "sv", "zh-CN", + "zh-Hant", "yue-Hant", "ja", "vi",