From daa95e5dea17e24056e2d7d3af51d9f739b60229 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Fri, 14 Aug 2026 10:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20`ZH`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chsrc-main.c | 12 ++++++------ src/framework/core.c | 44 +++++++++++++++++++++--------------------- src/framework/struct.h | 4 ++-- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 407bd241..fad9751d 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -1212,7 +1212,7 @@ main (int argc, char const *argv[]) } #define MSG_EN_USE_LIST_TARGETS "Use `chsrc list targets` to see all supported targets" -#define MSG_CN_USE_LIST_TARGETS "使用 chsrc list targets 查看所有支持的目标" +#define MSG_ZH_USE_LIST_TARGETS "使用 chsrc list targets 查看所有支持的目标" /* chsrc measure */ else if ( xy_streql (command, "measure") @@ -1225,7 +1225,7 @@ main (int argc, char const *argv[]) if (argc < cli_arg_Target_pos) { char *msg = ENGLISH ? "Please provide the target name you want to measure. " MSG_EN_USE_LIST_TARGETS - : "请提供想要测速源的目标名。" MSG_CN_USE_LIST_TARGETS; + : "请提供想要测速源的目标名。" MSG_ZH_USE_LIST_TARGETS; chsrc_error (msg); return Exit_Unknown; } @@ -1252,7 +1252,7 @@ main (int argc, char const *argv[]) if (argc < cli_arg_Target_pos) { char *msg = ENGLISH ? "Please provide the target name you want to view the source. " MSG_EN_USE_LIST_TARGETS - : "请提供想要查看源的目标名。" MSG_CN_USE_LIST_TARGETS; + : "请提供想要查看源的目标名。" MSG_ZH_USE_LIST_TARGETS; chsrc_error (msg); return Exit_Unknown; } @@ -1276,7 +1276,7 @@ main (int argc, char const *argv[]) if (argc < cli_arg_Target_pos) { char *msg = ENGLISH ? "Please provide the target name you want to set the source. " MSG_EN_USE_LIST_TARGETS - : "请提供想要设置源的目标名。" MSG_CN_USE_LIST_TARGETS; + : "请提供想要设置源的目标名。" MSG_ZH_USE_LIST_TARGETS; chsrc_error (msg); return Exit_Unknown; } @@ -1308,7 +1308,7 @@ main (int argc, char const *argv[]) if (argc < cli_arg_Target_pos) { char *msg = ENGLISH ? "Please provide the target name you want to reset the source. " MSG_EN_USE_LIST_TARGETS - : "请提供想要重置源的目标名。" MSG_CN_USE_LIST_TARGETS; + : "请提供想要重置源的目标名。" MSG_ZH_USE_LIST_TARGETS; chsrc_error (msg); return Exit_Unknown; } @@ -1349,7 +1349,7 @@ not_found: if (!the_found_target) { char *msg = ENGLISH ? "Unknown target. " MSG_EN_USE_LIST_TARGETS - : "暂不支持的换源目标。" MSG_CN_USE_LIST_TARGETS; + : "暂不支持的换源目标。" MSG_ZH_USE_LIST_TARGETS; chsrc_error (msg); return Exit_Unknown; } diff --git a/src/framework/core.c b/src/framework/core.c index c14ef58f..7c4c823d 100644 --- a/src/framework/core.c +++ b/src/framework/core.c @@ -820,7 +820,7 @@ measure_speed_for_every_source (Source_t sources[], int size, double speed_recor speed = -1024*1024*1024; if (!src.url) { - psmi.skip_reason_CN = "缺乏对上游默认源进行测速的URL,请帮助补充"; + psmi.skip_reason_ZH = "缺乏对上游默认源进行测速的URL,请帮助补充"; psmi.skip_reason_EN = "Lack of URL to measure upstream default source provider, please help to add"; } } @@ -838,7 +838,7 @@ measure_speed_for_every_source (Source_t sources[], int size, double speed_recor speed_records[i] = speed; const char *msg = ENGLISH ? provider->abbr : provider->name; - const char *skip_reason = ENGLISH ? psmi.skip_reason_EN : psmi.skip_reason_CN; + const char *skip_reason = ENGLISH ? psmi.skip_reason_EN : psmi.skip_reason_ZH; if (NULL==skip_reason) { skip_reason = ENGLISH ? "SKIP for no reason" : "无理由跳过"; @@ -1154,25 +1154,25 @@ chsrc_determine_chgtype (ChgType_t type) #define MSG_EN_PUBLIC_URL "If the URL you specify is a public service, you are invited to contribute: chsrc issue" -#define MSG_CN_PUBLIC_URL "若您指定的URL为公有服务,邀您参与贡献: chsrc issue" +#define MSG_ZH_PUBLIC_URL "若您指定的URL为公有服务,邀您参与贡献: chsrc issue" #define MSG_EN_FULLY_AUTO "Fully-Auto changed source. " -#define MSG_CN_FULLY_AUTO "全自动换源完成" +#define MSG_ZH_FULLY_AUTO "全自动换源完成" #define MSG_EN_SEMI_AUTO "Semi-Auto changed source. " -#define MSG_CN_SEMI_AUTO "半自动换源完成" +#define MSG_ZH_SEMI_AUTO "半自动换源完成" #define MSG_EN_THANKS "Thanks to the mirror site: " -#define MSG_CN_THANKS "感谢镜像提供方: " +#define MSG_ZH_THANKS "感谢镜像提供方: " #define MSG_EN_BETTER "If you have a better source changing method , please help: chsrc issue" -#define MSG_CN_BETTER "若您有更好的换源方案,邀您帮助: chsrc issue" +#define MSG_ZH_BETTER "若您有更好的换源方案,邀您帮助: chsrc issue" #define MSG_EN_CONSTRAINT "Implementation constraints require manual operation according to the above prompts. " -#define MSG_CN_CONSTRAINT "因实现约束需按上述提示手工操作" +#define MSG_ZH_CONSTRAINT "因实现约束需按上述提示手工操作" #define MSG_EN_STILL "Still need to operate manually according to the above prompts. " -#define MSG_CN_STILL "仍需按上述提示手工操作" +#define MSG_ZH_STILL "仍需按上述提示手工操作" #define thank_mirror(msg) say(xy_2strcat(msg,purple(ENGLISH?source->mirror->abbr:source->mirror->name))) @@ -1200,19 +1200,19 @@ chsrc_conclude (Source_t *source) if (source_is_userdefine (source)) { char *msg = ENGLISH ? MSG_EN_FULLY_AUTO MSG_EN_PUBLIC_URL \ - : MSG_CN_FULLY_AUTO ", " MSG_CN_PUBLIC_URL; + : MSG_ZH_FULLY_AUTO ", " MSG_ZH_PUBLIC_URL; chsrc_log (msg); } else { char *msg = ENGLISH ? MSG_EN_FULLY_AUTO MSG_EN_THANKS \ - : MSG_CN_FULLY_AUTO ", " MSG_CN_THANKS; + : MSG_ZH_FULLY_AUTO ", " MSG_ZH_THANKS; thank_mirror (msg); } } else { - char *msg = ENGLISH ? MSG_EN_FULLY_AUTO : MSG_CN_FULLY_AUTO; + char *msg = ENGLISH ? MSG_EN_FULLY_AUTO : MSG_ZH_FULLY_AUTO; chsrc_log (msg); } } @@ -1223,24 +1223,24 @@ chsrc_conclude (Source_t *source) if (source_is_userdefine (source)) { char *msg = ENGLISH ? MSG_EN_SEMI_AUTO MSG_EN_STILL MSG_EN_PUBLIC_URL \ - : MSG_CN_SEMI_AUTO ", " MSG_CN_STILL "。" MSG_CN_PUBLIC_URL; + : MSG_ZH_SEMI_AUTO ", " MSG_ZH_STILL "。" MSG_ZH_PUBLIC_URL; chsrc_log (msg); } else { char *msg = ENGLISH ? MSG_EN_SEMI_AUTO MSG_EN_STILL MSG_EN_THANKS \ - : MSG_CN_SEMI_AUTO ", " MSG_CN_STILL "。" MSG_CN_THANKS; + : MSG_ZH_SEMI_AUTO ", " MSG_ZH_STILL "。" MSG_ZH_THANKS; thank_mirror (msg); } } else { char *msg = ENGLISH ? MSG_EN_SEMI_AUTO MSG_EN_STILL \ - : MSG_CN_SEMI_AUTO ", " MSG_CN_STILL; + : MSG_ZH_SEMI_AUTO ", " MSG_ZH_STILL; chsrc_log (msg); } - char *msg = ENGLISH ? MSG_EN_BETTER : MSG_CN_BETTER; + char *msg = ENGLISH ? MSG_EN_BETTER : MSG_ZH_BETTER; chsrc_warn (msg); } else if (ChgType_Manual == ProgStatus.chgtype) @@ -1250,22 +1250,22 @@ chsrc_conclude (Source_t *source) if (source_is_userdefine (source)) { char *msg = ENGLISH ? MSG_EN_CONSTRAINT MSG_EN_PUBLIC_URL \ - : MSG_CN_CONSTRAINT "; " MSG_CN_PUBLIC_URL; + : MSG_ZH_CONSTRAINT "; " MSG_ZH_PUBLIC_URL; chsrc_log (msg); } else { char *msg = ENGLISH ? MSG_EN_CONSTRAINT MSG_EN_THANKS \ - : MSG_CN_CONSTRAINT ", " MSG_CN_THANKS; + : MSG_ZH_CONSTRAINT ", " MSG_ZH_THANKS; thank_mirror (msg); } } else { - char *msg = ENGLISH ? MSG_EN_CONSTRAINT : MSG_CN_CONSTRAINT; + char *msg = ENGLISH ? MSG_EN_CONSTRAINT : MSG_ZH_CONSTRAINT; chsrc_log (msg); } - char *msg = ENGLISH ? MSG_EN_BETTER : MSG_CN_BETTER; + char *msg = ENGLISH ? MSG_EN_BETTER : MSG_ZH_BETTER; chsrc_warn (msg); } else if (ChgType_Untested == ProgStatus.chgtype) @@ -1274,12 +1274,12 @@ chsrc_conclude (Source_t *source) { if (source_is_userdefine (source)) { - char *msg = ENGLISH ? MSG_EN_PUBLIC_URL : MSG_CN_PUBLIC_URL; + char *msg = ENGLISH ? MSG_EN_PUBLIC_URL : MSG_ZH_PUBLIC_URL; chsrc_log (msg); } else { - char *msg = ENGLISH ? MSG_EN_THANKS : MSG_CN_THANKS; + char *msg = ENGLISH ? MSG_EN_THANKS : MSG_ZH_THANKS; thank_mirror (msg); } } diff --git a/src/framework/struct.h b/src/framework/struct.h index b69af445..d7a7fed1 100644 --- a/src/framework/struct.h +++ b/src/framework/struct.h @@ -7,7 +7,7 @@ * Contributors : @livelycode36 * | * Created On : <2023-08-29> - * Last Modified : <2026-08-12> + * Last Modified : <2026-08-14> * * chsrc struct * ------------------------------------------------------------*/ @@ -15,7 +15,7 @@ typedef struct ProviderSpeedMeasureInfo_t { bool skip; /* 是否默认跳过 */ - char *skip_reason_CN; /* 跳过的原因(中文)*/ + char *skip_reason_ZH; /* 跳过的原因(中文)*/ char *skip_reason_EN; /* 跳过的原因(英文)*/ char *url; /* 测速链接 */ bool accurate; /* 是否为精准测速,上游源和专用镜像站为 ACCURATE,通用镜像站为 ROUGH */