diff --git a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboEngineConfigService.kt b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboEngineConfigService.kt index 66079445..f346f7f5 100644 --- a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboEngineConfigService.kt +++ b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboEngineConfigService.kt @@ -305,16 +305,16 @@ class TurboEngineConfigService @Autowired constructor( with(turboEnginConfigEntity) { TurboEngineConfigVO( engineCode = engineCode, - engineName = engineName, + engineName = I18NUtil.getMessage("$engineCode.engineName") ?: engineName, priorityNum = priorityNum, - desc = desc, + desc = I18NUtil.getMessage("$engineCode.desc") ?: desc, spelExpression = spelExpression, spelParamMap = spelParamMap, enabled = enabled, - userManual = userManual, + userManual = translateEngineUserManual(engineCode, userManual ?: ""), docUrl = docUrl, recommend = recommend, - recommendReason = recommendReason, + recommendReason = I18NUtil.getMessage("$engineCode.recommendReason") ?: recommendReason, pluginTips = pluginTips, paramConfig = paramConfig?.map { ParamConfigModel( diff --git a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties index 950fa5e9..57085e70 100644 --- a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties +++ b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_en.properties @@ -28,9 +28,9 @@ disttask-ue4.paramConfig.worker_version.tips=If the requirements are not met, pl disttask-ue4.paramConfig.worker_version.paramEnum.win2019-pure-drived=Windows General Environment disttask-ue4.paramConfig.worker_version.paramEnum.macvm=MacOS General Environment disttask-ue4.paramConfig.worker_version.paramEnum.tlinux2.2-generic=TLinux2.2 General Environment -disttask-ue4.paramConfig.queue_name.paramName=Acceleration Platform +disttask-ue4.paramConfig.queue_name.paramName=Acceleration OS -distcc.desc=【Deprecated】Traditional distcc approach, suitable for C/C++ compilation under Linux. +distcc.desc=\u3010Deprecated\u3011Traditional distcc approach, suitable for C/C++ compilation under Linux. distcc.userManual.0=After the acceleration plan is configured, there are three access methods: distcc.userManual.1=Method 1 distcc.userManual.2=If your project has previously been associated with the "Bash" plug-in of the pipeline and executed compilation acceleration, while keeping the original access method unchanged, replace the new solution id you applied for with the original @@ -65,7 +65,7 @@ taskStatus.staging=Staging taskStatus.starting=Starting taskStatus.running=Running taskStatus.failed=Failed -taskStatus.finish=Finish +taskStatus.finish=Finished 2121001=Internal server error 2121002=Failed to call the third-party interface. Please query the log diff --git a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties index fb3139b9..a0c20ecb 100644 --- a/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties +++ b/src/backend/turbo/boot-turbo/src/main/resources/i18n/message_zh_CN.properties @@ -1,77 +1,77 @@ -disttask-cc.desc=全新自研引擎,零侵入一键加速,更快的速度,提供可视化编译图表,清晰掌控全流程数据。支持pch、gcov、分布式预处理等更多功能。 -disttask-cc.recommendReason=全新自研引擎,零侵入一键加速,更快的速度,提供可视化编译图表,清晰掌控全流程数据。支持pch、gcov、分布式预处理等更多功能。 +disttask-cc.desc=\u5168\u65B0\u81EA\u7814\u5F15\u64CE\uFF0C\u96F6\u4FB5\u5165\u4E00\u952E\u52A0\u901F\uFF0C\u66F4\u5FEB\u7684\u901F\u5EA6\uFF0C\u63D0\u4F9B\u53EF\u89C6\u5316\u7F16\u8BD1\u56FE\u8868\uFF0C\u6E05\u6670\u638C\u63A7\u5168\u6D41\u7A0B\u6570\u636E\u3002\u652F\u6301pch\u3001gcov\u3001\u5206\u5E03\u5F0F\u9884\u5904\u7406\u7B49\u66F4\u591A\u529F\u80FD\u3002 +disttask-cc.recommendReason=\u5168\u65B0\u81EA\u7814\u5F15\u64CE\uFF0C\u96F6\u4FB5\u5165\u4E00\u952E\u52A0\u901F\uFF0C\u66F4\u5FEB\u7684\u901F\u5EA6\uFF0C\u63D0\u4F9B\u53EF\u89C6\u5316\u7F16\u8BD1\u56FE\u8868\uFF0C\u6E05\u6670\u638C\u63A7\u5168\u6D41\u7A0B\u6570\u636E\u3002\u652F\u6301pch\u3001gcov\u3001\u5206\u5E03\u5F0F\u9884\u5904\u7406\u7B49\u66F4\u591A\u529F\u80FD\u3002 -disttask-cc.userManual.0=配置好加速方案后,有两种使用方式: -disttask-cc.userManual.1=方式一: -disttask-cc.userManual.2=在流水线中使用,添加【Turbo-编译加速】插件,选择加速方案,配置加速脚本后执行流水线。 -disttask-cc.userManual.3=查看使用指引 -disttask-cc.userManual.4=方式二: -disttask-cc.userManual.5=在私人构建机上使用 +disttask-cc.userManual.0=\u914D\u7F6E\u597D\u52A0\u901F\u65B9\u6848\u540E\uFF0C\u6709\u4E24\u79CD\u4F7F\u7528\u65B9\u5F0F\uFF1A +disttask-cc.userManual.1=\u65B9\u5F0F\u4E00\uFF1A +disttask-cc.userManual.2=\u5728\u6D41\u6C34\u7EBF\u4E2D\u4F7F\u7528\uFF0C\u6DFB\u52A0\u3010Turbo-\u7F16\u8BD1\u52A0\u901F\u3011\u63D2\u4EF6\uFF0C\u9009\u62E9\u52A0\u901F\u65B9\u6848\uFF0C\u914D\u7F6E\u52A0\u901F\u811A\u672C\u540E\u6267\u884C\u6D41\u6C34\u7EBF\u3002 +disttask-cc.userManual.3=\u67E5\u770B\u4F7F\u7528\u6307\u5F15 +disttask-cc.userManual.4=\u65B9\u5F0F\u4E8C\uFF1A +disttask-cc.userManual.5=\u5728\u79C1\u4EBA\u6784\u5EFA\u673A\u4E0A\u4F7F\u7528 -disttask-cc.engineName=Linux-C/C++ 加速 -disttask-cc.paramConfig.queue_name.paramName=优先调度区域 -disttask-cc.paramConfig.queue_name.paramEnum.K8S\://gd=深圳K8S集群(推荐) -disttask-cc.paramConfig.queue_name.paramEnum.shenzhen=深圳/广州 -disttask-cc.paramConfig.queue_name.paramEnum.shanghai=上海/南京 -disttask-cc.paramConfig.queue_name.paramEnum.chengdu=成都/重庆 -disttask-cc.paramConfig.queue_name.paramEnum.tianjin=北京/天津 -disttask-cc.paramConfig.worker_version.paramName=编译器版本 -disttask-cc.paramConfig.ccache_enabled.paramName=是否启用Ccache +disttask-cc.engineName=Linux-C/C++ \u52A0\u901F +disttask-cc.paramConfig.queue_name.paramName=\u4F18\u5148\u8C03\u5EA6\u533A\u57DF +disttask-cc.paramConfig.queue_name.paramEnum.K8S\://gd=\u6DF1\u5733K8S\u96C6\u7FA4\uFF08\u63A8\u8350\uFF09 +disttask-cc.paramConfig.queue_name.paramEnum.shenzhen=\u6DF1\u5733/\u5E7F\u5DDE +disttask-cc.paramConfig.queue_name.paramEnum.shanghai=\u4E0A\u6D77/\u5357\u4EAC +disttask-cc.paramConfig.queue_name.paramEnum.chengdu=\u6210\u90FD/\u91CD\u5E86 +disttask-cc.paramConfig.queue_name.paramEnum.tianjin=\u5317\u4EAC/\u5929\u6D25 +disttask-cc.paramConfig.worker_version.paramName=\u7F16\u8BD1\u5668\u7248\u672C +disttask-cc.paramConfig.ccache_enabled.paramName=\u662F\u5426\u542F\u7528Ccache -disttask-ue4.desc=自研引擎,多平台下的 UE4 构建加速。支持 Editor、Shader、Dedicated Servers 等加速。 -disttask-ue4.recommendReason=自研引擎,多平台下的 UE4 构建加速。支持 Editor、Shader、Dedicated Servers 等加速。 -disttask-ue4.userManual.0=配置好加速方案后,根据指引来手动接入: -disttask-ue4.userManual.1=查看使用指引 -disttask-ue4.engineName=UE4加速 -disttask-ue4.paramConfig.worker_version.paramName=编译环境 -disttask-ue4.paramConfig.worker_version.tips=若不满足需求,请联系 DevOps-helper -disttask-ue4.paramConfig.worker_version.paramEnum.win2019-pure-drived=Windows通用环境 -disttask-ue4.paramConfig.worker_version.paramEnum.macvm=Mac通用环境 -disttask-ue4.paramConfig.worker_version.paramEnum.tlinux2.2-generic=TLinux2.2通用环境 -disttask-ue4.paramConfig.queue_name.paramName=加速平台 +disttask-ue4.desc=\u81EA\u7814\u5F15\u64CE\uFF0C\u591A\u5E73\u53F0\u4E0B\u7684 UE4 \u6784\u5EFA\u52A0\u901F\u3002\u652F\u6301 Editor\u3001Shader\u3001Dedicated Servers \u7B49\u52A0\u901F\u3002 +disttask-ue4.recommendReason=\u81EA\u7814\u5F15\u64CE\uFF0C\u591A\u5E73\u53F0\u4E0B\u7684 UE4 \u6784\u5EFA\u52A0\u901F\u3002\u652F\u6301 Editor\u3001Shader\u3001Dedicated Servers \u7B49\u52A0\u901F\u3002 +disttask-ue4.userManual.0=\u914D\u7F6E\u597D\u52A0\u901F\u65B9\u6848\u540E\uFF0C\u6839\u636E\u6307\u5F15\u6765\u624B\u52A8\u63A5\u5165\uFF1A +disttask-ue4.userManual.1=\u67E5\u770B\u4F7F\u7528\u6307\u5F15 +disttask-ue4.engineName=UE4\u52A0\u901F +disttask-ue4.paramConfig.worker_version.paramName=\u7F16\u8BD1\u73AF\u5883 +disttask-ue4.paramConfig.worker_version.tips=\u82E5\u4E0D\u6EE1\u8DB3\u9700\u6C42\uFF0C\u8BF7\u8054\u7CFB DevOps-helper +disttask-ue4.paramConfig.worker_version.paramEnum.win2019-pure-drived=Windows\u901A\u7528\u73AF\u5883 +disttask-ue4.paramConfig.worker_version.paramEnum.macvm=Mac\u901A\u7528\u73AF\u5883 +disttask-ue4.paramConfig.worker_version.paramEnum.tlinux2.2-generic=TLinux2.2\u901A\u7528\u73AF\u5883 +disttask-ue4.paramConfig.queue_name.paramName=\u52A0\u901F\u5E73\u53F0 -distcc.desc=【旧版本】传统distcc方案, 适用于linux下的c/c++编译 -distcc.userManual.0=配置好加速方案后,有三种接入方式: -distcc.userManual.1=方式一 -distcc.userManual.2=如果你的项目之前用流水线的“Bash”插件关联并执行编译加速,保持原来的接入方式不变的情况下,将申请到的新的方案id,替换到原来的 -distcc.userManual.3=这个参数中,即可正常使用。 -distcc.userManual.4=方式二 -distcc.userManual.5=在流水线中使用,添加【编译加速】插件,选择加速方案,配置加速脚本后执行流水线。 -distcc.userManual.6=查看使用指引 -distcc.userManual.7=方式三 -distcc.userManual.8=在私人构建机上使用 +distcc.desc=\u3010\u65E7\u7248\u672C\u3011\u4F20\u7EDFdistcc\u65B9\u6848, \u9002\u7528\u4E8Elinux\u4E0B\u7684c/c++\u7F16\u8BD1 +distcc.userManual.0=\u914D\u7F6E\u597D\u52A0\u901F\u65B9\u6848\u540E\uFF0C\u6709\u4E09\u79CD\u63A5\u5165\u65B9\u5F0F\uFF1A +distcc.userManual.1=\u65B9\u5F0F\u4E00 +distcc.userManual.2=\u5982\u679C\u4F60\u7684\u9879\u76EE\u4E4B\u524D\u7528\u6D41\u6C34\u7EBF\u7684\u201CBash\u201D\u63D2\u4EF6\u5173\u8054\u5E76\u6267\u884C\u7F16\u8BD1\u52A0\u901F\uFF0C\u4FDD\u6301\u539F\u6765\u7684\u63A5\u5165\u65B9\u5F0F\u4E0D\u53D8\u7684\u60C5\u51B5\u4E0B\uFF0C\u5C06\u7533\u8BF7\u5230\u7684\u65B0\u7684\u65B9\u6848id\uFF0C\u66FF\u6362\u5230\u539F\u6765\u7684 +distcc.userManual.3=\u8FD9\u4E2A\u53C2\u6570\u4E2D\uFF0C\u5373\u53EF\u6B63\u5E38\u4F7F\u7528\u3002 +distcc.userManual.4=\u65B9\u5F0F\u4E8C +distcc.userManual.5=\u5728\u6D41\u6C34\u7EBF\u4E2D\u4F7F\u7528\uFF0C\u6DFB\u52A0\u3010\u7F16\u8BD1\u52A0\u901F\u3011\u63D2\u4EF6\uFF0C\u9009\u62E9\u52A0\u901F\u65B9\u6848\uFF0C\u914D\u7F6E\u52A0\u901F\u811A\u672C\u540E\u6267\u884C\u6D41\u6C34\u7EBF\u3002 +distcc.userManual.6=\u67E5\u770B\u4F7F\u7528\u6307\u5F15 +distcc.userManual.7=\u65B9\u5F0F\u4E09 +distcc.userManual.8=\u5728\u79C1\u4EBA\u6784\u5EFA\u673A\u4E0A\u4F7F\u7528 distcc.engineName=distcc -distcc.paramConfig.city.paramName=优先调度区域 -distcc.paramConfig.city.paramEnum.K8S\://gd=深圳K8S集群(推荐) -distcc.paramConfig.city.paramEnum.shenzhen=深圳/广州 -distcc.paramConfig.city.paramEnum.shanghai=上海/南京 -distcc.paramConfig.city.paramEnum.chengdu=成都/重庆 -distcc.paramConfig.city.paramEnum.tianjin=北京/天津 -distcc.paramConfig.gcc_version.paramName=编译器版本 -distcc.paramConfig.ccache_enabled.paramName=是否启用Ccache +distcc.paramConfig.city.paramName=\u4F18\u5148\u8C03\u5EA6\u533A\u57DF +distcc.paramConfig.city.paramEnum.K8S\://gd=\u6DF1\u5733K8S\u96C6\u7FA4\uFF08\u63A8\u8350\uFF09 +distcc.paramConfig.city.paramEnum.shenzhen=\u6DF1\u5733/\u5E7F\u5DDE +distcc.paramConfig.city.paramEnum.shanghai=\u4E0A\u6D77/\u5357\u4EAC +distcc.paramConfig.city.paramEnum.chengdu=\u6210\u90FD/\u91CD\u5E86 +distcc.paramConfig.city.paramEnum.tianjin=\u5317\u4EAC/\u5929\u6D25 +distcc.paramConfig.gcc_version.paramName=\u7F16\u8BD1\u5668\u7248\u672C +distcc.paramConfig.ccache_enabled.paramName=\u662F\u5426\u542F\u7528Ccache -displayFields.taskId=任务ID -displayFields.plan=方案 -displayFields.queue_name.fieldName=加速集群地区 -displayFields.request_cpu.fieldName=加速资源 -displayFields.worker_version.fieldName=Worker 版本 -displayFields.client_version.fieldName=Client 版本 -displayFields.client_ip.fieldName=发起机器 IP +displayFields.taskId=\u4EFB\u52A1ID +displayFields.plan=\u65B9\u6848 +displayFields.queue_name.fieldName=\u52A0\u901F\u96C6\u7FA4\u5730\u533A +displayFields.request_cpu.fieldName=\u52A0\u901F\u8D44\u6E90 +displayFields.worker_version.fieldName=Worker \u7248\u672C +displayFields.client_version.fieldName=Client \u7248\u672C +displayFields.client_ip.fieldName=\u53D1\u8D77\u673A\u5668 IP displayFields.ccache_enabled.fieldName=Ccache -displayFields.task_id.fieldName=查看编译过程数据 -displayFields.pipeline=关联的流水线 +displayFields.task_id.fieldName=\u67E5\u770B\u7F16\u8BD1\u8FC7\u7A0B\u6570\u636E +displayFields.pipeline=\u5173\u8054\u7684\u6D41\u6C34\u7EBF -taskStatus.staging=准备中 -taskStatus.starting=正在开始 -taskStatus.running=正在构建 -taskStatus.failed=构建失败 -taskStatus.finish=构建完成 +taskStatus.staging=\u51C6\u5907\u4E2D +taskStatus.starting=\u6B63\u5728\u5F00\u59CB +taskStatus.running=\u6B63\u5728\u6784\u5EFA +taskStatus.failed=\u6784\u5EFA\u5931\u8D25 +taskStatus.finish=\u6784\u5EFA\u5B8C\u6210 -2121001=内部服务错误 -2121002=调用第三方接口失败,请查询日志 -2121003=没有查询到数据,请检查参数 -2121004=请求参数异常 -2121005=无权限,请先加入项目 -2121006=子类检查错误 +2121001=\u5185\u90E8\u670D\u52A1\u9519\u8BEF +2121002=\u8C03\u7528\u7B2C\u4E09\u65B9\u63A5\u53E3\u5931\u8D25\uFF0C\u8BF7\u67E5\u8BE2\u65E5\u5FD7 +2121003=\u6CA1\u6709\u67E5\u8BE2\u5230\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5\u53C2\u6570 +2121004=\u8BF7\u6C42\u53C2\u6570\u5F02\u5E38 +2121005=\u65E0\u6743\u9650\uFF0C\u8BF7\u5148\u52A0\u5165\u9879\u76EE +2121006=\u5B50\u7C7B\u68C0\u67E5\u9519\u8BEF -bizError.engineCodeNotBlank=请先选择加速模式! +bizError.engineCodeNotBlank=\u8BF7\u5148\u9009\u62E9\u52A0\u901F\u6A21\u5F0F\uFF01 diff --git a/src/backend/turbo/common-turbo/common-turbo-web/src/main/kotlin/com/tencent/devops/common/web/config/WebAutoConfiguration.kt b/src/backend/turbo/common-turbo/common-turbo-web/src/main/kotlin/com/tencent/devops/common/web/config/WebAutoConfiguration.kt index 03f724d9..130ad636 100644 --- a/src/backend/turbo/common-turbo/common-turbo-web/src/main/kotlin/com/tencent/devops/common/web/config/WebAutoConfiguration.kt +++ b/src/backend/turbo/common-turbo/common-turbo-web/src/main/kotlin/com/tencent/devops/common/web/config/WebAutoConfiguration.kt @@ -13,6 +13,8 @@ import org.springframework.context.annotation.Primary import org.springframework.context.support.ResourceBundleMessageSource import org.springframework.http.converter.HttpMessageConverter import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.validation.Validator +import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean import org.springframework.web.servlet.config.annotation.InterceptorRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurer import java.nio.charset.StandardCharsets @@ -53,4 +55,16 @@ class WebAutoConfiguration : WebMvcConfigurer { override fun addInterceptors(registry: InterceptorRegistry) { registry.addInterceptor(LocaleInterceptor()) } + + /** + * 配置Spring Boot Validation框架和Spring Boot自身使用同样的国际化配置 + */ + @Bean + override fun getValidator(): Validator { + val bean = LocalValidatorFactoryBean() + // 仅兼容Spring Boot spring.messages和原hibernate-validator的国际化文件 + // 不支持resource/ValidationMessages.properties系列 + bean.setValidationMessageSource(this.messageSource()) + return bean + } }