jyy
2021-01-26 ab2879bbcb846256cc182198b9c04e50fbc276c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.matrix.core.tools;
 
import java.util.Locale;
 
import org.springframework.context.MessageSource;
 
/**
 * 国际化信息工具
 * 
 * @author JIANGYOUYAO
 * @email 935090232@qq.com
 * @date 2017年11月30日
 */
public class InternationaUtil {
    /**
     * 获取语言环境中.propertoes中定义的信息
     * 
     * @author JIANGYOUYAO
     * @email 935090232@qq.com
     * @date 2017年11月28日
     * @param errorCode
     * @param param
     * @return
     */
    public static String getMesssge(String code, Object... param) {
        MessageSource messageSource = (MessageSource) WebUtil.getApplicationContext().getBean("messageSource");
        return messageSource.getMessage(code, param, Locale.getDefault());
    }
}