feat: 嵌套翻译支持英文enDict
This commit is contained in:
@@ -209,9 +209,12 @@ public class TranslationAspect {
|
||||
String code = field.getAnnotation(Dict.class).dicCode();
|
||||
String text = field.getAnnotation(Dict.class).dicText();
|
||||
String table = field.getAnnotation(Dict.class).dictTable();
|
||||
String enText = field.getAnnotation(Dict.class).dicEnText();
|
||||
String key = String.valueOf(item.get(field.getName()));
|
||||
String textValue = translateDictValue(code, text, table, key, listDict);
|
||||
String enValue = translateDictValue(code, enText, table, key, listDict);
|
||||
item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue);
|
||||
item.put(field.getName() + CommonConstant.DICT_TEXT_EN_SUFFIX, enValue);
|
||||
}
|
||||
|
||||
if (Objects.equals(field.getType().getName(), "java.util.Date") && field.getAnnotation(JsonFormat.class) == null && item.get(field.getName()) != null) {
|
||||
|
||||
@@ -39,4 +39,13 @@ public @interface Dict {
|
||||
* @return 返回类型: String
|
||||
*/
|
||||
String dictTable() default "";
|
||||
|
||||
/**
|
||||
* 方法描述: 数据字典表
|
||||
* 作 者: dangzhenghui
|
||||
* 日 期: 2019年03月17日-下午9:37:16
|
||||
*
|
||||
* @return 返回类型: String
|
||||
*/
|
||||
String dicEnText() default "";
|
||||
}
|
||||
|
||||
@@ -160,6 +160,7 @@ public class CommonConstant {
|
||||
|
||||
/**字典翻译文本后缀*/
|
||||
public static final String DICT_TEXT_SUFFIX = "_dictText";
|
||||
public static final String DICT_TEXT_EN_SUFFIX = "_dictTextEn";
|
||||
|
||||
/**
|
||||
* 表单设计器主表类型
|
||||
|
||||
Reference in New Issue
Block a user