From a9685519129d4c10fe16109bfdad985bb1806212 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sat, 4 Apr 2026 19:54:34 +0800 Subject: [PATCH] ~i18n fix --- scripts/lang/chs/menu.lang | 6 ++++++ scripts/lang/en/menu.lang | 6 ++++++ scripts/menu.sh | 16 ++++++++-------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/scripts/lang/chs/menu.lang b/scripts/lang/chs/menu.lang index 0ba87225..9615b9cb 100644 --- a/scripts/lang/chs/menu.lang +++ b/scripts/lang/chs/menu.lang @@ -1,6 +1,8 @@ # ===== 通用提示 ===== MENU_RESTART_NOTICE="检测到配置变更,是否立即重启服务以应用新配置?" +MENU_RESTART_NOW="立即重启" +MENU_RESTART_LATER="暂不重启" MENU_PORT_CONFLICT_TITLE="检测到端口被以下进程占用!内核可能无法正常启动!" MENU_PORT_CONFLICT_HINT="请修改默认端口配置!" @@ -13,6 +15,8 @@ MENU_CFG_LOADED_OK="配置文件加载完成!" MENU_OVERRIDE_WARN="你已经禁用了配置文件覆写功能,这会导致大量脚本功能无法使用!" MENU_OVERRIDE_ASK="是否取消禁用?" +MENU_YES="是" +MENU_NO="否" # ===== 欢迎与状态 ===== MENU_WELCOME="欢迎使用ShellCrash!" @@ -37,6 +41,8 @@ MENU_TG_CHANNEL="TG频道:" # ===== /tmp 文件检测 ===== MENU_TMP_CORE_FOUND="发现可用的内核文件:" MENU_TMP_CORE_ASK="是否立即加载该内核(会停止当前服务)?" +MENU_LOAD_NOW="立即加载" +MENU_LOAD_LATER="暂不加载" MENU_TMP_CFG_FOUND="发现内核配置文件:" MENU_TMP_CFG_ASK="是否立即加载为配置文件?" diff --git a/scripts/lang/en/menu.lang b/scripts/lang/en/menu.lang index bded58e7..ece6d34a 100644 --- a/scripts/lang/en/menu.lang +++ b/scripts/lang/en/menu.lang @@ -1,6 +1,8 @@ # ===== Common Prompts ===== MENU_RESTART_NOTICE="Changes have been detected. Please restart the service!" +MENU_RESTART_NOW="Restart now" +MENU_RESTART_LATER="Not now" MENU_PORT_CONFLICT_TITLE="The port is occupied by the following process. The core may fail to start!" MENU_PORT_CONFLICT_HINT="Please modify the default port configuration!" @@ -13,6 +15,8 @@ MENU_CFG_LOADED_OK="Configuration file loaded successfully!" MENU_OVERRIDE_WARN="You have disabled configuration overwrite. This will cause many features to be unavailable!" MENU_OVERRIDE_ASK="Cancel the disable setting?" +MENU_YES="Yes" +MENU_NO="No" # ===== Welcome & Status ===== MENU_WELCOME="Welcome to ShellCrash!" @@ -37,6 +41,8 @@ MENU_TG_CHANNEL="Telegram Channel: " # ===== /tmp File Detection ===== MENU_TMP_CORE_FOUND="Available core file found:" MENU_TMP_CORE_ASK="Load this core file? (The current service will be stopped)" +MENU_LOAD_NOW="Load now" +MENU_LOAD_LATER="Not now" MENU_TMP_CFG_FOUND="Kernel configuration file found:" MENU_TMP_CFG_ASK="Load as the configuration file? (1/0) > " diff --git a/scripts/menu.sh b/scripts/menu.sh index 4f85cb7c..c902871c 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -33,8 +33,8 @@ load_lang menu checkrestart() { comp_box "\033[32m$MENU_RESTART_NOTICE\033[0m" - btm_box "1) 立即重启" \ - "0) 暂不重启" + btm_box "1) $MENU_RESTART_NOW" \ + "0) $MENU_RESTART_LATER" read -r -p "$COMMON_INPUT> " res if [ "$res" = 1 ]; then start_service @@ -147,8 +147,8 @@ ckstatus() { local tmp_file="/tmp/$file" comp_box "$MENU_TMP_CORE_FOUND \033[36m$tmp_file\033[0m" \ "$MENU_TMP_CORE_ASK" - btm_box "1) 立即加载" \ - "0) 暂不加载" + btm_box "1) $MENU_LOAD_NOW" \ + "0) $MENU_LOAD_LATER" read -r -p "$COMMON_INPUT> " res [ "$res" = 1 ] && { zip_type=$(echo "$tmp_file" | grep -oE 'tar.gz$|upx$|gz$') @@ -170,8 +170,8 @@ ckstatus() { local tmp_file="/tmp/$file" comp_box "$MENU_TMP_CFG_FOUND\033[36m$tmp_file\033[0m" \ "$MENU_TMP_CFG_ASK" - btm_box "1) 立即加载" \ - "0) 暂不加载" + btm_box "1) $MENU_LOAD_NOW" \ + "0) $MENU_LOAD_LATER" read -p "$COMMON_INPUT> " res [ "$res" = 1 ] && { if [ -n "$(echo $tmp_file | grep -iE '.json$')" ]; then @@ -187,8 +187,8 @@ ckstatus() { [ "$disoverride" = "1" ] && { comp_box "\033[33m$MENU_OVERRIDE_WARN\033[0m" \ "$MENU_OVERRIDE_ASK" - btm_box "1) 是" \ - "0) 否" + btm_box "1) $MENU_YES" \ + "0) $MENU_NO" read -p "$COMMON_INPUT> " res [ "$res" = 1 ] && unset disoverride && setconfig disoverride }