Skip to content

Commit 0eb6579

Browse files
committed
refactor(HealthChecks): 将健康检查消息从中文改为英文
统一健康检查相关消息的输出语言为英文,提高国际化支持
1 parent c71abe0 commit 0eb6579

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

GameFrameX.StartUp/Extensions/HealthChecksExtensions.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ public static IServiceCollection AddGameFrameXHealthChecks(this IServiceCollecti
7676
{
7777
var healthChecksBuilder = services.AddHealthChecks();
7878
// 基础应用程序健康检查
79-
healthChecksBuilder.AddCheck(DefaultHealthCheckPath, () => HealthCheckResult.Healthy("应用程序运行正常"));
80-
healthChecksBuilder.AddCheck(SimpleHealthCheckPath, () => HealthCheckResult.Healthy("应用程序运行正常"));
79+
healthChecksBuilder.AddCheck(DefaultHealthCheckPath, () => HealthCheckResult.Healthy("the application is working fine"));
80+
// 简单健康检查(兼容性端点)
81+
healthChecksBuilder.AddCheck(SimpleHealthCheckPath, () => HealthCheckResult.Healthy("the application is working fine"));
8182

8283
// OpenTelemetry相关检查
8384
if (setting.IsOpenTelemetry)
8485
{
85-
healthChecksBuilder.AddCheck(OpenTelemetryHealthCheckPath, () => HealthCheckResult.Healthy("OpenTelemetry 配置正常"));
86+
healthChecksBuilder.AddCheck(OpenTelemetryHealthCheckPath, () => HealthCheckResult.Healthy("OpenTelemetry the configuration is normal"));
8687
}
8788

8889
return services;
@@ -169,20 +170,20 @@ public static IApplicationBuilder UseGameFrameXHealthChecks(this IApplicationBui
169170
ResponseWriter = async (context, _) =>
170171
{
171172
context.Response.ContentType = JsonContentType;
172-
await context.Response.WriteAsync("OpenTelemetry 配置正常");
173+
await context.Response.WriteAsync("OpenTelemetry is configured normally");
173174
},
174175
};
175176
app.UseHealthChecks(OpenTelemetryHealthCheckPath, openTelemetryHealthCheckOptions);
176177
}
177178

178-
LogHelper.InfoConsole("健康检查端点已启用:");
179+
LogHelper.InfoConsole("the health check endpoint is enabled:");
179180
foreach (var ip in ipList)
180181
{
181-
LogHelper.InfoConsole($"- 详细健康检查: http://{ip}:{setting.HttpPort}{DefaultHealthCheckPath}");
182-
LogHelper.InfoConsole($"- 简单健康检查: http://{ip}:{setting.HttpPort}{SimpleHealthCheckPath}");
182+
LogHelper.InfoConsole($"- detailed health checks: http://{ip}:{setting.HttpPort}{DefaultHealthCheckPath}");
183+
LogHelper.InfoConsole($"- simple health check: http://{ip}:{setting.HttpPort}{SimpleHealthCheckPath}");
183184
if (setting.IsOpenTelemetry)
184185
{
185-
LogHelper.InfoConsole($"- OpenTelemetry 检查: http://{ip}:{setting.HttpPort}{OpenTelemetryHealthCheckPath}");
186+
LogHelper.InfoConsole($"- OpenTelemetry check: http://{ip}:{setting.HttpPort}{OpenTelemetryHealthCheckPath}");
186187
}
187188
}
188189

0 commit comments

Comments
 (0)