多语言优化

This commit is contained in:
xintaofei
2026-03-07 10:24:13 +08:00
parent 934f689b08
commit 28babff52c
7 changed files with 115 additions and 21 deletions

View File

@@ -2,13 +2,15 @@ import type { AppLocale, SystemLanguageSettings } from "@/lib/types"
export const APP_LOCALES: readonly AppLocale[] = ["en", "zh_cn", "zh_tw"]
const FALLBACK_APP_LOCALE: AppLocale = "en"
export const LANGUAGE_SETTINGS_STORAGE_KEY = "codeg.system_language_settings"
export type IntlLocale = "en" | "zh-CN" | "zh-TW"
export const DEFAULT_LANGUAGE_SETTINGS: SystemLanguageSettings = {
mode: "system",
language: FALLBACK_APP_LOCALE,
}
export const APP_LOCALE_TO_INTL_LOCALE: Record<AppLocale, string> = {
export const APP_LOCALE_TO_INTL_LOCALE: Record<AppLocale, IntlLocale> = {
en: "en",
zh_cn: "zh-CN",
zh_tw: "zh-TW",