From 9ce4a23b7b68a83ec13ee8f0548ac7d0414e9beb Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 1 Feb 2024 11:57:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B6=88=E6=81=AF=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/system/service/NoticeSendService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ae1c14e703..d1cb56237a 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 @@ -85,8 +85,10 @@ public class NoticeSendService { private static void setLanguage(NoticeModel noticeModel) { String language = (String) noticeModel.getParamMap().get("Language"); Locale locale = Locale.SIMPLIFIED_CHINESE; - if (StringUtils.isNotBlank(language)) { - locale = Locale.forLanguageTag(language); + if (StringUtils.containsIgnoreCase("US",language)) { + locale = Locale.US; + } else if (StringUtils.containsIgnoreCase("TW",language)){ + locale = Locale.TAIWAN; } LocaleContextHolder.setLocale(locale); }