From b662a829236522607cf917bd92838c70b7e5362e Mon Sep 17 00:00:00 2001 From: unitwk Date: Tue, 5 Mar 2024 19:14:57 +0800 Subject: [PATCH] Feat: i18n --- daemon/src/entity/commands/general/general_update.ts | 5 +++++ frontend/src/types/const.ts | 2 +- frontend/src/widgets/instance/Terminal.vue | 2 +- frontend/src/widgets/setupApp/McPreset.vue | 12 +++--------- languages/en_US.json | 6 +++++- languages/zh_CN.json | 6 +++++- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/daemon/src/entity/commands/general/general_update.ts b/daemon/src/entity/commands/general/general_update.ts index a7261ee4..6ed64243 100755 --- a/daemon/src/entity/commands/general/general_update.ts +++ b/daemon/src/entity/commands/general/general_update.ts @@ -35,6 +35,11 @@ export default class GeneralUpdateCommand extends InstanceCommand { logger.info($t("TXT_CODE_general_update.updateCmd", { instanceUuid: instance.instanceUuid })); logger.info(updateCommand); + instance.println( + $t("TXT_CODE_general_update.update"), + $t("TXT_CODE_general_update.readyUpdate", { instanceUuid: instance.instanceUuid }) + ); + // command parsing const commandList = commandStringToArray(updateCommand); const commandExeFile = commandList[0]; diff --git a/frontend/src/types/const.ts b/frontend/src/types/const.ts index e7662f12..209bacb4 100644 --- a/frontend/src/types/const.ts +++ b/frontend/src/types/const.ts @@ -24,7 +24,7 @@ export enum INSTANCE_STATUS_CODE { export const INSTANCE_STATUS: Record = { [INSTANCE_STATUS_CODE.UNKNOWN]: t("TXT_CODE_342a04a9"), - [INSTANCE_STATUS_CODE.STOPPED]: t("未运行"), + [INSTANCE_STATUS_CODE.STOPPED]: t("TXT_CODE_15f2e564"), [INSTANCE_STATUS_CODE.STOPPING]: t("TXT_CODE_a409b8a9"), [INSTANCE_STATUS_CODE.STARTING]: t("TXT_CODE_175b570d"), [INSTANCE_STATUS_CODE.RUNNING]: t("TXT_CODE_bdb620b9") diff --git a/frontend/src/widgets/instance/Terminal.vue b/frontend/src/widgets/instance/Terminal.vue index 87fa9ba1..60d55206 100644 --- a/frontend/src/widgets/instance/Terminal.vue +++ b/frontend/src/widgets/instance/Terminal.vue @@ -319,7 +319,7 @@ onMounted(async () => { diff --git a/frontend/src/widgets/setupApp/McPreset.vue b/frontend/src/widgets/setupApp/McPreset.vue index 38657a99..c1bbf1cb 100644 --- a/frontend/src/widgets/setupApp/McPreset.vue +++ b/frontend/src/widgets/setupApp/McPreset.vue @@ -166,12 +166,6 @@ onMounted(async () => { - @@ -199,9 +193,9 @@ onMounted(async () => { -
{{ t("环境要求") }}: {{ item.runtime }}
-
{{ t("硬件要求") }}: {{ item.hardware }}
-
{{ t("大小") }}: {{ item.size }}
+
{{ t("TXT_CODE_18b94497") }}: {{ item.runtime }}
+
{{ t("TXT_CODE_683e3033") }}: {{ item.hardware }}
+
{{ t("TXT_CODE_94bb113a") }}: {{ item.size }}

diff --git a/languages/en_US.json b/languages/en_US.json index ebc04e19..244a28e3 100644 --- a/languages/en_US.json +++ b/languages/en_US.json @@ -1820,5 +1820,9 @@ "TXT_CODE_2082f653": "Default: /workspace/", "TXT_CODE_26495d02": "You can enter a startup command, such as java -jar demo.jar. If no startup command is entered, the command defined inside the image will be used.", "TXT_CODE_a85091a4": "Automatically assigned by default", - "TXT_CODE_7da6e84": "Complete all required fields to create. For more options, please go to instance settings after creation." + "TXT_CODE_7da6e84": "Complete all required fields to create. For more options, please go to instance settings after creation.", + "TXT_CODE_276756b2": "Are you sure?", + "TXT_CODE_51a1fffb": "Filter", + "TXT_CODE_18b94497": "System Requirements", + "TXT_CODE_683e3033": "Hardware Requirements" } diff --git a/languages/zh_CN.json b/languages/zh_CN.json index cc53ef03..9812b5a7 100644 --- a/languages/zh_CN.json +++ b/languages/zh_CN.json @@ -1820,5 +1820,9 @@ "TXT_CODE_2082f653": "默认:/workspace/", "TXT_CODE_26495d02": "可以填写启动命令,如 java -jar demo.jar,不填写启动命令将以镜像内部定义的命令为准", "TXT_CODE_a85091a4": "默认自动分配", - "TXT_CODE_7da6e84": "完善所有必填项后即可创建,更多其他设置请创建完成后,在应用实例设置中可以编辑!" + "TXT_CODE_7da6e84": "完善所有必填项后即可创建,更多其他设置请创建完成后,在应用实例设置中可以编辑!", + "TXT_CODE_276756b2": "你确定要执行此操作吗?", + "TXT_CODE_51a1fffb": "筛选", + "TXT_CODE_18b94497": "环境要求", + "TXT_CODE_683e3033": "硬件要求" }