多语言支持
parent
d802a3b200
commit
830c3f32ad
@ -0,0 +1,35 @@
|
||||
package com.engine.organization.transmethod;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/06/11
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class CardAccessTrans {
|
||||
static Map<String, Integer> map = new HashMap<>();
|
||||
|
||||
static {
|
||||
map.put("个人信息", 547578);
|
||||
map.put("工作信息", 547579);
|
||||
map.put("基本信息", 547175);
|
||||
}
|
||||
|
||||
|
||||
public static String getMultiLanguage(String text, String languageId) {
|
||||
Integer language = Convert.toInt(languageId, -1);
|
||||
if (-1 == language) {
|
||||
return text;
|
||||
}
|
||||
Integer labelId = map.get(text);
|
||||
if (null == language) {
|
||||
return text;
|
||||
}
|
||||
return SystemEnv.getHtmlLabelName(labelId,language);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue