diff --git a/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java b/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java index 2a094360a2..c82e8872d9 100644 --- a/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java +++ b/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java @@ -17,6 +17,7 @@ import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.WebSocketUtil; import io.metersphere.dto.BaseCase; import io.metersphere.dto.MsExecResponseDTO; +import io.metersphere.i18n.Translator; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.notice.annotation.SendNotice; import io.metersphere.request.ResetOrderRequest; @@ -369,7 +370,7 @@ public class ApiScenarioController { try { return apiAutomationService.verifyScenarioEnv(request); } catch (Exception e) { - MSException.throwException("场景步骤解析错误,检查是否包含插件步骤!"); + MSException.throwException(Translator.get("scenario_step_parsing_error_check")); } return false; } @@ -379,7 +380,7 @@ public class ApiScenarioController { try { return apiAutomationService.verifyScenarioEnv(scenarioId); } catch (Exception e) { - MSException.throwException("场景步骤解析错误,检查是否包含插件步骤!"); + MSException.throwException(Translator.get("scenario_step_parsing_error_check")); } return false; } diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java index 12a443b32a..417d54cb0c 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java @@ -1680,7 +1680,7 @@ public class ApiDefinitionService { if (StringUtils.isNotBlank(request.getSwaggerUrl())) { if (!request.getPlatform().equalsIgnoreCase("Swagger2")) { this.sendFailMessage(request, project); - MSException.throwException("文件格式不符合要求"); + MSException.throwException(Translator.get("file_format_does_not_meet_requirements")); } try { UrlTestUtils.testUrl(request.getSwaggerUrl(), 30000); @@ -1773,17 +1773,17 @@ public class ApiDefinitionService { private void checkFileSuffixName(ApiTestImportRequest request, String suffixName) { if (suffixName.equalsIgnoreCase("jmx")) { if (!request.getPlatform().equalsIgnoreCase("JMeter")) { - MSException.throwException("文件格式不符合要求"); + MSException.throwException(Translator.get("file_format_does_not_meet_requirements")); } } if (suffixName.equalsIgnoreCase("har")) { if (!request.getPlatform().equalsIgnoreCase("Har")) { - MSException.throwException("文件格式不符合要求"); + MSException.throwException(Translator.get("file_format_does_not_meet_requirements")); } } if (suffixName.equalsIgnoreCase("json")) { if (request.getPlatform().equalsIgnoreCase("Har") || request.getPlatform().equalsIgnoreCase("Jmeter")) { - MSException.throwException("文件格式不符合要求"); + MSException.throwException(Translator.get("file_format_does_not_meet_requirements")); } } } @@ -2203,7 +2203,7 @@ public class ApiDefinitionService { schedule.setName(new java.net.URL(swaggerUrlProject.getSwaggerUrl()).getHost()); } catch (MalformedURLException e) { LogUtil.error(e.getMessage(), e); - MSException.throwException("URL 格式不正确!"); + MSException.throwException(Translator.get("url_is_not_valid")); } schedule.setJob(SwaggerUrlImportJob.class.getName()); schedule.setGroup(ScheduleGroup.SWAGGER_IMPORT.name()); @@ -2233,7 +2233,7 @@ public class ApiDefinitionService { schedule.setName(new java.net.URL(swaggerUrlProject.getSwaggerUrl()).getHost()); } catch (MalformedURLException e) { LogUtil.error(e.getMessage(), e); - MSException.throwException("URL 格式不正确!"); + MSException.throwException(Translator.get("url_is_not_valid")); } scheduleService.editSchedule(schedule); request.setResourceId(swaggerUrlProject.getId()); diff --git a/api-test/backend/src/main/resources/i18n/messages_en_US.properties b/api-test/backend/src/main/resources/i18n/messages_en_US.properties index df000fe405..d731e6333f 100644 --- a/api-test/backend/src/main/resources/i18n/messages_en_US.properties +++ b/api-test/backend/src/main/resources/i18n/messages_en_US.properties @@ -344,4 +344,6 @@ update_api_case=Updated interface use case api_case_update_notice=Interface use case update notification error_xml_struct=Data is not xml case_name_is_already_exist=Duplicate Case name -delete_check_reference_by_plan=referenced by the test plan \ No newline at end of file +file_format_does_not_meet_requirements=File format does not meet requirements +url_is_not_valid=URL is not valid +scenario_step_parsing_error_check=Scenario step parsing error, check if plugin step is included! \ No newline at end of file diff --git a/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties b/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties index 5703cbc7c3..dd6d6b09f5 100644 --- a/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -363,4 +363,7 @@ update_api_case=更新了接口用例 api_case_update_notice=接口用例更新通知 error_xml_struct=错误的xml数据 case_name_is_already_exist=用例名称不能重复 -delete_check_reference_by_plan=被测试计划引用 +file_format_does_not_meet_requirements=文件格式不符合要求 +url_is_not_valid=URL 格式不正确! +scenario_step_parsing_error_check=场景步骤解析错误,请检查是否包含插件步骤! + diff --git a/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties b/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties index 8d28d283d1..c9dfd0798b 100644 --- a/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -363,4 +363,6 @@ update_api_case=更新了接口用例 api_case_update_notice=接口用例更新通知 error_xml_struct=錯誤的xml數據 case_name_is_already_exist=用例名稱不能重復 -delete_check_reference_by_plan=被測試計劃引用 +file_format_does_not_meet_requirements=文件格式不符合要求 +url_is_not_valid=URL 格式不正确! +scenario_step_parsing_error_check=場景步驟解析錯誤,檢查是否包含插件步驟!