多语言方法
This commit is contained in:
parent
59a38954bc
commit
a54cbce2bc
|
|
@ -1,5 +1,9 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
/**
|
||||
* 多语言工具类
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -20,6 +24,26 @@ public class SalaryI18nUtil {
|
|||
public static String getI18nLabel(int labelId, String defaultLabel) {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所语言信息
|
||||
*
|
||||
* @param labelId 多语言对应的labelId
|
||||
* @param languageId 用户语言id
|
||||
* @param defaultLabel 默认中文
|
||||
* @return
|
||||
*/
|
||||
public static String getI18nLabel(int labelId, int languageId, String defaultLabel) {
|
||||
if(ObjectUtils.isEmpty(labelId) || ObjectUtils.isEmpty(languageId)){
|
||||
return defaultLabel;
|
||||
}
|
||||
String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, languageId);
|
||||
if(StringUtils.isBlank(htmlLabelName)){
|
||||
return defaultLabel;
|
||||
}
|
||||
return htmlLabelName;
|
||||
}
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 获取多语言信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue