国际化资源文件调整

This commit is contained in:
RuoYi
2019-04-24 14:42:12 +08:00
parent ce9463569f
commit d9aa73a7ad
4 changed files with 13 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package com.ruoyi.common.utils;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import com.ruoyi.common.utils.spring.SpringUtils;
/**
@ -15,11 +16,11 @@ public class MessageUtils
*
* @param code 消息键
* @param args 参数
* @return
* @return 获取国际化翻译值
*/
public static String message(String code, Object... args)
{
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
return messageSource.getMessage(code, args, null);
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
}
}