chore: i18n code

This commit is contained in:
YuMao 2024-10-30 14:34:57 +08:00
parent 78dcc1de4f
commit 3822a7bfb4
5 changed files with 14 additions and 6 deletions

View File

@ -16,7 +16,7 @@ export default class GeneralKillCommand extends InstanceCommand {
return instance.failure(new Error($t("TXT_CODE_general_stop.notRunning")));
}
if (instance.startTimestamp + 6 * 1000 > Date.now()) {
return instance.failure(new Error($t("程序必须运行超过6秒才能被强制停止")));
return instance.failure(new Error($t("TXT_CODE_6259357c")));
}
const task = instance?.asynchronousTask;

View File

@ -50,7 +50,7 @@ export class GoPtyProcessAdapter extends EventEmitter implements IInstanceProces
private initNamedPipe() {
if (!fs.existsSync(this.pipeName)) {
throw new Error(
$t("程序启动失败,输入输出流不可读:{{pipeName}}", {
$t("TXT_CODE_9d1d244f", {
pipeName: this.pipeName
})
);

View File

@ -229,7 +229,7 @@ export default class Instance extends EventEmitter {
setLock(bool: boolean) {
if (this.lock === true && bool === true) {
throw new Error($t("实例有其他任务正在进行中,无法进行此操作!"));
throw new Error($t("TXT_CODE_ca030197"));
}
this.lock = bool;
}
@ -306,7 +306,7 @@ export default class Instance extends EventEmitter {
const currentTimestamp = new Date().getTime();
const startThreshold = 2 * 1000;
if (currentTimestamp - this.startTimestamp < startThreshold) {
this.println("ERROR", $t("实例进程启动失败,请检查启动命令和运行环境等配置!"));
this.println("ERROR", $t("TXT_CODE_aae2918f"));
}
}

View File

@ -1951,5 +1951,9 @@
"TXT_CODE_a6424dcc": "The working directory or startup command cannot be empty",
"TXT_CODE_ffa884f9": "Warning: The working directory is not mounted to the container, and the container will not be able to access files in the instance's working directory",
"TXT_CODE_6c232c9c": "Used to mount additional folders on the host into the container, supports two variable strings: &lbrace;mcsm_workspace&rbrace; (working directory) and &lbrace;mcsm_instance_id&rbrace; (instance ID).",
"TXT_CODE_fa487a47": "Provide the following variable strings: &lbrace;mcsm_instance_id&rbrace; = instance ID, &lbrace;mcsm_workspace&rbrace; = instance installation directory"
"TXT_CODE_fa487a47": "Provide the following variable strings: &lbrace;mcsm_instance_id&rbrace; = instance ID, &lbrace;mcsm_workspace&rbrace; = instance installation directory",
"TXT_CODE_6259357c": "The program must run for more than 6 seconds before it can be forced to stop!",
"TXT_CODE_9d1d244f": "Program startup failed, input and output streams are unreadable: {{pipeName}}",
"TXT_CODE_ca030197": "The instance has other tasks in progress, and this operation cannot be performed!",
"TXT_CODE_aae2918f": "The instance process failed to start, please check the startup command and operating environment configuration!"
}

View File

@ -1951,5 +1951,9 @@
"TXT_CODE_a6424dcc": "工作目录和启动命令不可为空",
"TXT_CODE_ffa884f9": "警告:工作目录没有挂载到容器中,容器将无法访问到实例工作目录中的文件",
"TXT_CODE_6c232c9c": "用于挂载主机上额外的文件夹到容器中,支持 &lbrace;mcsm_workspace&rbrace;(工作目录)和 &lbrace;mcsm_instance_id&rbrace;实例ID两个变量字符串。",
"TXT_CODE_fa487a47": "提供以下变量字符串:&lbrace;mcsm_instance_id&rbrace; = 实例ID&lbrace;mcsm_workspace&rbrace; = 实例安装目录"
"TXT_CODE_fa487a47": "提供以下变量字符串:&lbrace;mcsm_instance_id&rbrace; = 实例ID&lbrace;mcsm_workspace&rbrace; = 实例安装目录",
"TXT_CODE_6259357c": "程序必须运行超过6秒才能被强制停止",
"TXT_CODE_9d1d244f": "程序启动失败,输入输出流不可读:{{pipeName}}",
"TXT_CODE_ca030197": "实例有其他任务正在进行中,无法进行此操作!",
"TXT_CODE_aae2918f": "实例进程启动失败,请检查启动命令和运行环境等配置!"
}