diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommentNoticeService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommentNoticeService.java index 702a83deb9..237cb27090 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommentNoticeService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommentNoticeService.java @@ -81,9 +81,9 @@ public class BugCommentNoticeService { private static void setLanguage(String language) { Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US",language)) { + if (StringUtils.containsIgnoreCase(language, "US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW",language)){ + } else if (StringUtils.containsIgnoreCase(language, "TW")){ locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugSyncNoticeService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugSyncNoticeService.java index 8cfb904bf7..98555cdba2 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugSyncNoticeService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugSyncNoticeService.java @@ -89,9 +89,9 @@ public class BugSyncNoticeService { private static void setLanguage(String language) { Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US",language)) { + if (StringUtils.containsIgnoreCase(language, "US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW",language)){ + } else if (StringUtils.containsIgnoreCase(language, "TW")){ locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java index 8fb25c4f87..af9dd09feb 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java @@ -193,9 +193,9 @@ public class FunctionalCaseCommentService { private static void setLanguage(String language) { Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US",language)) { + if (StringUtils.containsIgnoreCase(language, "US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW",language)){ + } else if (StringUtils.containsIgnoreCase(language, "TW")){ locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/ReviewSendNoticeService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/ReviewSendNoticeService.java index f3bc49f9ca..03b23ccfad 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/ReviewSendNoticeService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/ReviewSendNoticeService.java @@ -89,9 +89,9 @@ public class ReviewSendNoticeService { private static void setLanguage(String language) { Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US",language)) { + if (StringUtils.containsIgnoreCase(language, "US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW",language)){ + } else if (StringUtils.containsIgnoreCase(language, "TW")){ locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonNoticeSendService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonNoticeSendService.java index 24ba78251a..011a698c3c 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonNoticeSendService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonNoticeSendService.java @@ -116,9 +116,9 @@ public class CommonNoticeSendService { private static void setLanguage(String language) { Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US", language)) { + if (StringUtils.containsIgnoreCase(language, "US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW", language)) { + } else if (StringUtils.containsIgnoreCase(language, "TW")) { locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/NoticeSendService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/NoticeSendService.java index acac9b73d5..06f712a0c5 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/NoticeSendService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/NoticeSendService.java @@ -92,9 +92,9 @@ public class NoticeSendService { private static void setLanguage(NoticeModel noticeModel) { String language = (String) noticeModel.getParamMap().get("Language"); Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US",language)) { + if (StringUtils.containsIgnoreCase(language,"US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW",language)){ + } else if (StringUtils.containsIgnoreCase(language,"TW")){ locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); @@ -102,9 +102,9 @@ public class NoticeSendService { public void setLanguage(String language) { Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US",language)) { + if (StringUtils.containsIgnoreCase(language,"US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW",language)){ + } else if (StringUtils.containsIgnoreCase(language,"TW")){ locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java index f99c2971f3..b3a80a2a6d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java @@ -98,9 +98,9 @@ public class TestPlanSendNoticeService { private static void setLanguage(String language) { Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.containsIgnoreCase("US", language)) { + if (StringUtils.containsIgnoreCase(language, "US")) { locale = Locale.US; - } else if (StringUtils.containsIgnoreCase("TW", language)) { + } else if (StringUtils.containsIgnoreCase(language, "TW")) { locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale);