From 42e54321af7774f28edf4cf937c896f441883224 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Sat, 17 Aug 2024 20:07:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B):=20?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/bug/service/BugCommentNoticeService.java | 4 ++-- .../io/metersphere/bug/service/BugSyncNoticeService.java | 4 ++-- .../functional/service/FunctionalCaseCommentService.java | 4 ++-- .../functional/service/ReviewSendNoticeService.java | 4 ++-- .../system/service/CommonNoticeSendService.java | 4 ++-- .../io/metersphere/system/service/NoticeSendService.java | 8 ++++---- .../plan/service/TestPlanSendNoticeService.java | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) 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);