1. 在项目的resources文件夹下新建对应的properties文件
    
    英文文件:validator_en_US.properties
    中文文件:validator_zh_CN.properties
    
2. 在对应的文件中加入对应的中英文内容
    class="validator_en_US.properties">
        l0012=the verify code you entered is incorrect
    
    
        l0012=您输入的验证码不正确
    
3. 打开中文properties文件转码
    
    使用native2ascii进行转码
    
    (1) 打开validator_zh_CN.properties文件所在的目录
    
dos">
        cd D:\AndrewProject\XXX\XXX\src\main\resources
    
    (2) 将文件转成ascii格式
    
        native2ascii validator_zh_CN.properties validator_zh_CN.properties
    
    转化之后的内容
    
        l0012=\u60A8\u8F93\u5165\u7684\u9A8C\u8BC1\u7801\u4E0D\u6B63\u786E
    
4. 使用Util调用properties的内容
    
    public static String getValMsg(String code){
        try {
            ResourceBundle bundleSC = ResourceBundle.getBundle("validator",Locale.TRADITIONAL_CHINESE);
            String msgSC = bundleSC.getString(code);
            return msgSC;
        } catch (Exception e) {
            return "没有找到对应的验证信息";
        }
    }
    
补充说明
    
    (1) 使用native2ascii转码
        native2ascii inputFile.txt outputFile.txt
    (2) 使用java读取properties内容
        读取文件 ResourceBundle bundleSC 
            = ResourceBundle.getBundle("validator",Locale.TRADITIONAL_CHINESE);
        ① validator对应validator_zh_CN.properties中的文件名
        ② Locale.TRADITIONAL_CHINESE代表中文
           Locale.US代表英文
        读取属性值String value = bundleUS.getString("key");