feat(图表): 数值格式化内,数量单位支持配置英文简称

#14335
This commit is contained in:
ulleo
2025-04-02 11:42:59 +08:00
committed by dataeaseShu
parent 85ba1f3951
commit 6388a3c538
8 changed files with 40 additions and 11 deletions

View File

@@ -1,8 +1,12 @@
package io.dataease.i18n;
import io.dataease.utils.CacheUtils;
import lombok.Getter;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import static io.dataease.constant.CacheConstant.UserCacheConstant.USER_COMMUNITY_LANGUAGE;
@Getter
public enum Lang {
@@ -43,4 +47,20 @@ public enum Lang {
return null;
}
public static boolean isChinese() {
String lang = null;
Object langObj = CacheUtils.get(USER_COMMUNITY_LANGUAGE, "de");
if (ObjectUtils.isNotEmpty(langObj) && StringUtils.isNotBlank(langObj.toString())) {
lang = langObj.toString();
}
if (StringUtils.isBlank(lang)) {
return true;
}
if (StringUtils.startsWithIgnoreCase(lang, "zh")) {
return true;
}
return false;
}
}