国际化资源文件调整
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user