diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java index 86f16bb2d4..0a26556cd9 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java @@ -9,6 +9,7 @@ import io.metersphere.base.mapper.TestPlanTestCaseMapper; import io.metersphere.base.mapper.ext.ExtTestCaseMapper; import io.metersphere.commons.constants.TestCaseConstants; import io.metersphere.commons.utils.BeanUtils; +import io.metersphere.i18n.Translator; import io.metersphere.track.dto.TestCaseDTO; import io.metersphere.track.dto.TestCaseNodeDTO; import io.metersphere.exception.ExcelException; @@ -46,7 +47,8 @@ public class TestCaseNodeService { public String addNode(TestCaseNode node) { if(node.getLevel() > TestCaseConstants.MAX_NODE_DEPTH){ - throw new RuntimeException("模块树最大深度为" + TestCaseConstants.MAX_NODE_DEPTH + "层!"); + throw new RuntimeException(Translator.get("test_case_node_level_tip") + + TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level")); } node.setCreateTime(System.currentTimeMillis()); node.setUpdateTime(System.currentTimeMillis()); @@ -243,7 +245,7 @@ public class TestCaseNodeService { nodePaths.forEach(path -> { if (path == null) { - throw new ExcelException("所属模块不能为空!"); + throw new ExcelException(Translator.get("test_case_module_not_null")); } List nodeNameList = new ArrayList<>(Arrays.asList(path.split("/"))); Iterator pathIterator = nodeNameList.iterator(); @@ -252,7 +254,7 @@ public class TestCaseNodeService { String rootNodeName = null; if (nodeNameList.size() <= 1) { - throw new ExcelException("创建模块失败:" + path); + throw new ExcelException(Translator.get("test_case_module_not_null") + ":" + path); } else { pathIterator.next(); pathIterator.remove(); diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 2353b857ef..e1a3f74450 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -224,7 +224,8 @@ public class TestCaseService { } public void testCaseTemplateExport(HttpServletResponse response) { - EasyExcelUtil.export(response, TestCaseExcelData.class, generateExportTemplate(), "测试用例模版", "模版"); + EasyExcelUtil.export(response, TestCaseExcelData.class, generateExportTemplate(), + Translator.get("test_case_import_template_name"), Translator.get("test_case_import_template_sheet")); } private List generateExportTemplate() { diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties index 96544b3fdc..9ed63647c2 100644 --- a/backend/src/main/resources/i18n/messages.properties +++ b/backend/src/main/resources/i18n/messages.properties @@ -1,2 +1,8 @@ test_case_exist= -before_delete_plan= \ No newline at end of file +before_delete_plan= +test_case_node_level_tip= +test_case_node_level= +test_case_module_not_null= +test_case_create_moule_fail= +test_case_import_template_name= +test_case_import_template_sheet= \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 64b1a1dfba..2c259c5861 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -24,6 +24,7 @@ cannot_edit_load_test_running=Cannot modify the running test test_not_found=Test cannot be found: test_not_running=Test is not running before_delete_plan=There is an associated test case under this plan, please unlink it first! +test_case_node_level_tip=The node tree maximum depth is user_email_already_exists=User email already exists user_name_is_null=User name cannot be null user_email_is_null=User email cannot be null @@ -33,4 +34,9 @@ workspace_not_exists=Workspace is not exists api_load_script_error=Load script error user_id_already_exists=User ID already exists password_modification_failed=Password modification failed -cannot_delete_current_user=Cannot delete the user currently logged in \ No newline at end of file +cannot_delete_current_user=Cannot delete the user currently logged in +test_case_node_level=level +test_case_module_not_null=The owned module cannot be empty +test_case_create_moule_fail=Failed to create module +test_case_import_template_name=Test case templates +test_case_import_template_sheet=Template \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 4304cc53b2..4272998a62 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -33,4 +33,12 @@ workspace_not_exists=工作空间不存在 api_load_script_error=读取脚本失败 user_id_already_exists=用户id已存在 password_modification_failed=密码修改失败 -cannot_delete_current_user=无法删除当前登录用户 \ No newline at end of file +cannot_delete_current_user=无法删除当前登录用户 +#test case start +test_case_node_level=层 +test_case_node_level_tip=模块树最大深度为 +test_case_module_not_null=所属模块不能为空 +test_case_create_moule_fail=创建模块失败 +test_case_import_template_name=测试用例模版 +test_case_import_template_sheet=模版 +#test case end \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 6f3a64cfb9..777656a854 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -33,4 +33,12 @@ workspace_not_exists=工作空間不存在 api_load_script_error=讀取腳本失敗 user_id_already_exists=用戶id已存在 password_modification_failed=密碼修改失敗 -cannot_delete_current_user=無法刪除當前登錄用戶 \ No newline at end of file +cannot_delete_current_user=無法刪除當前登錄用戶 +#test case start +test_case_node_level=層 +test_case_node_level_tip=模塊樹最大深度為 +test_case_module_not_null=所屬模塊不能為空 +test_case_create_moule_fail=創建模塊失敗 +test_case_import_template_name=測試用例模版 +test_case_import_template_sheet=模版 +#test case end \ No newline at end of file