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 定义配置文件路径相关配置
*/

View File

@@ -46,6 +46,14 @@ export function GetFullConfigPath(): Promise<string> & { cancel(): void } {
return $resultPromise;
}
/**
* GetLanguage 获取当前语言设置
*/
export function GetLanguage(): Promise<models$0.LanguageType> & { cancel(): void } {
let $resultPromise = $Call.ByID(3409375894) as any;
return $resultPromise;
}
/**
* ResetToDefault 重置为默认配置
*/
@@ -62,6 +70,14 @@ export function SaveAppConfig(config: models$0.AppConfig | null): Promise<void>
return $resultPromise;
}
/**
* SetLanguage 设置语言
*/
export function SetLanguage(language: models$0.LanguageType): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(814725002, language) as any;
return $resultPromise;
}
/**
* UpdateEditorConfig 更新编辑器配置
*/