Add i18n support

This commit is contained in:
2025-04-28 12:41:18 +08:00
parent 0d3df25a94
commit d7a848e7ad
7 changed files with 140 additions and 16 deletions

View File

@@ -28,6 +28,11 @@ export class AppConfig {
*/
"metadata": ConfigMetadata;
/**
* 界面语言
*/
"language": LanguageType;
/** Creates a new AppConfig instance. */
constructor($$source: Partial<AppConfig> = {}) {
if (!("editor" in $$source)) {
@@ -39,6 +44,9 @@ export class AppConfig {
if (!("metadata" in $$source)) {
this["metadata"] = (new ConfigMetadata());
}
if (!("language" in $$source)) {
this["language"] = ("" as LanguageType);
}
Object.assign(this, $$source);
}
@@ -158,6 +166,26 @@ export class EditorConfig {
}
}
/**
* LanguageType 语言类型定义
*/
export enum LanguageType {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero = "",
/**
* LangZhCN 中文简体
*/
LangZhCN = "zh-CN",
/**
* LangEnUS 英文-美国
*/
LangEnUS = "en-US",
};
/**
* PathConfig 定义配置文件路径相关配置
*/