You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
oa-flowable/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java

27 lines
713 B

4 years ago
package com.ruoyi.common.utils;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import com.ruoyi.common.utils.spring.SpringUtils;
/**
* i18n
*
* @author ruoyi
*/
public class MessageUtils
{
/**
* spring messageSource
*
* @param code
* @param args
* @return
*/
public static String message(String code, Object... args)
{
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
}
}