use of com.rogge.common.model.LanguageEnum in project spring-cloud by Rogge666.
the class Util method getCurrentLanguage.
/**
* 获取当前会话语言(如果找不到默认返回中文)
*
* @return
*/
public static LanguageEnum getCurrentLanguage() {
try {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
LanguageEnum language = (LanguageEnum) request.getSession().getAttribute(Constant.CURRENT_LANGUAGE);
if (language != null) {
return language;
}
} catch (Exception e) {
}
return LanguageEnum.zh_CN;
}
Aggregations