{
"error": 0,
"content": {
"page": {
"totalRows": 3,
"currentPage": 1,
"firstPage": 1,
"prePage": 1,
"nextPage": 1,
"lastPage": 1,
"pageRows": 20,
"pageCount": 1
},
"dataList": [
{
"username": "甜甜椒",
"mobile": null,
"orderSn": "",
"createTime": "2019-12-23 17:08:24",
"expireTime": null,
"score": -9,
"remark": "Admin operate"
},
{
"username": "甜甜椒",
"mobile": null,
"orderSn": "",
"createTime": "2019-12-23 17:08:24",
"expireTime": null,
"score": -9,
"remark": "我自己输入的"
},
{
"username": "甜甜椒",
"mobile": null,
"orderSn": "",
"createTime": "2019-12-23 17:08:24",
"expireTime": null,
"score": -9,
"remark": "Admin operate30-100"
}
]
},
"message": "success",
"language": "en_US"
}
Created
December 27, 2019 06:39
-
-
Save upangka/007912b94993f6ecfc306ff1b9724fd9 to your computer and use it in GitHub Desktop.
1. 系统信息国际化,2. 系统信息带数据国际化,3. 用户输入什么数据就是什么数据
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vpu.mp.service.pojo.shop.operation; | |
/** | |
* | |
* @author 黄壮壮 | |
* 积分备注内容消息 | |
*/ | |
public class RemarkScoreMessage { | |
/** | |
* 订单 | |
*/ | |
/** | |
* 会员卡 | |
*/ | |
/** 领卡赠送积分 */ | |
public static final String MSG_CARD_OPEN_SEND = "card.content.open.send"; | |
/** | |
* 登录 | |
*/ | |
/** | |
* 营销 | |
*/ | |
/** | |
* 管理员 | |
*/ | |
/** 管理员操作 */ | |
public static final String MSG_ADMIN_OPERATION = "admin.operation"; | |
public static final String MSG_ADMIN_OPERATION_TEST = "admin.operation.test"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vpu.mp.service.pojo.shop.operation; | |
/** | |
* @author 黄壮壮 | |
* 备注模块: | |
* 用户输入: 0, 代表的是用户自己输入 | |
* 登录签到相关:1开头四位数,如1001, | |
* 订单相关: 2开头四位数,如2001, | |
* 会员卡相关:3开头四位数,如3001, | |
* 营销相关: 4开头四位数,如4001, | |
* 管理员操作相关:5开头四位数,如5001, | |
* 依次类推) | |
* | |
*/ | |
public enum RemarkScoreTemplate { | |
/** 用户输入 */ | |
USER_INPUT_MSG(0,null), | |
/** | |
* 登录 | |
*/ | |
/** | |
* 会员卡 | |
*/ | |
/** 开卡赠送 */ | |
CARD_OPEN_SEND(3001,RemarkScoreMessage.MSG_CARD_OPEN_SEND), | |
/** | |
* 营销 | |
*/ | |
/** | |
* 管理员 | |
*/ | |
/** 管理员操作 */ | |
ADMIN_OPERATION(6001,RemarkScoreMessage.MSG_ADMIN_OPERATION), | |
ADMIN_OPERATION_TEST(6002,RemarkScoreMessage.MSG_ADMIN_OPERATION_TEST); | |
/** 返回码 */ | |
public int code; | |
/** 返回信息 */ | |
private String message; | |
private RemarkScoreTemplate(int code,String message) { | |
this.code = code; | |
this.message = message; | |
} | |
public static String getMessageByCode(Integer code) { | |
for(RemarkScoreTemplate item: RemarkScoreTemplate.values()) { | |
if(code.equals(item.code)) { | |
return item.message; | |
} | |
} | |
return null; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String remarkI18N(String language,Integer tmpId,String tmpData) { | |
// remark i18n | |
String remark; | |
String msgTmp = RemarkScoreTemplate.getMessageByCode(tmpId); | |
if(!StringUtils.isBlank(msgTmp)) { | |
// 系统定义信息 | |
if(StringUtils.isBlank(tmpData)) { | |
// 直接翻译 | |
remark = Util.translateMessage(language, msgTmp, LANGUAGE_TYPE); | |
}else { | |
// 需要数据进行翻译 | |
remark = Util.translateMessage(language, msgTmp, LANGUAGE_TYPE, (Object[])tmpData.split(",")); | |
} | |
}else { | |
// 来自用户输入的数据,不进行翻译 | |
remark = tmpData; | |
} | |
return remark; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment