mirror of
https://github.com/dataease/dataease.git
synced 2026-05-23 22:08:34 +08:00
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user