mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-23 15:03:51 +08:00
- 新增共享六语言词典、前端 i18n 运行时与语言设置入口 - 推进连接、驱动、数据网格、查询、AI、Redis、表设计等模块文案本地化 - 补充 raw 边界、SQL/驱动/更新场景测试与 i18n 扫描工具
15 lines
487 B
TypeScript
15 lines
487 B
TypeScript
export const DEFAULT_LANGUAGE = "zh-CN";
|
|
|
|
export const SUPPORTED_LANGUAGES = ["zh-CN", "en-US"] as const;
|
|
|
|
export type SupportedLanguage = (typeof SUPPORTED_LANGUAGES)[number];
|
|
|
|
export const isSupportedLanguage = (
|
|
value: unknown,
|
|
): value is SupportedLanguage =>
|
|
typeof value === "string" &&
|
|
(SUPPORTED_LANGUAGES as readonly string[]).includes(value);
|
|
|
|
export const resolveLanguage = (value: unknown): SupportedLanguage =>
|
|
isSupportedLanguage(value) ? value : DEFAULT_LANGUAGE;
|