refactor(消息管理): 增加消息通知语言环境
This commit is contained in:
parent
579c6e4015
commit
9ce4a23b7b
|
@ -85,8 +85,10 @@ public class NoticeSendService {
|
||||||
private static void setLanguage(NoticeModel noticeModel) {
|
private static void setLanguage(NoticeModel noticeModel) {
|
||||||
String language = (String) noticeModel.getParamMap().get("Language");
|
String language = (String) noticeModel.getParamMap().get("Language");
|
||||||
Locale locale = Locale.SIMPLIFIED_CHINESE;
|
Locale locale = Locale.SIMPLIFIED_CHINESE;
|
||||||
if (StringUtils.isNotBlank(language)) {
|
if (StringUtils.containsIgnoreCase("US",language)) {
|
||||||
locale = Locale.forLanguageTag(language);
|
locale = Locale.US;
|
||||||
|
} else if (StringUtils.containsIgnoreCase("TW",language)){
|
||||||
|
locale = Locale.TAIWAN;
|
||||||
}
|
}
|
||||||
LocaleContextHolder.setLocale(locale);
|
LocaleContextHolder.setLocale(locale);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue