fix: 尝试修复发布之后国际化消息不能正常显示的问题
This commit is contained in:
parent
db5182f37d
commit
6c0f1b50ed
|
@ -84,13 +84,11 @@ 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");
|
||||||
if (StringUtils.isBlank(language)) {
|
Locale locale = Locale.SIMPLIFIED_CHINESE;
|
||||||
language = "zh_CN";
|
if (StringUtils.isNotBlank(language)) {
|
||||||
|
locale = Locale.forLanguageTag(language);
|
||||||
}
|
}
|
||||||
if (language.contains("-")) {
|
LocaleContextHolder.setLocale(locale);
|
||||||
language = language.replace("-","_");
|
|
||||||
}
|
|
||||||
LocaleContextHolder.setLocale(Locale.of(language));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -144,4 +142,5 @@ public class NoticeSendService {
|
||||||
LogUtils.error(e.getMessage(), e);
|
LogUtils.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue