Browse Source

兼容

master
neil 7 years ago
parent
commit
0053a8c425
  1. 17
      designer-base/src/com/fr/design/formula/FunctionNAD.java

17
designer-base/src/com/fr/design/formula/FunctionNAD.java

@ -1,12 +1,14 @@
package com.fr.design.formula; package com.fr.design.formula;
import com.fr.general.Inter; import com.fr.base.FRContext;
import com.fr.script.CalculatorEmbeddedFunction;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.script.Function; import com.fr.stable.script.Function;
import java.util.Locale;
public class FunctionNAD extends AbstractNameAndDescription { public class FunctionNAD extends AbstractNameAndDescription {
private static final String LOCALE_PREFIX = "Fine-Core_Formula_";
private Function fn; private Function fn;
@ -22,9 +24,14 @@ public class FunctionNAD extends AbstractNameAndDescription {
if (fn == null) { if (fn == null) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
// 统一用Fine-Core_Formula_+公式小写名作为国际化的key Locale locale = FRContext.getLocale();
String localeKey = LOCALE_PREFIX + fn.getClass().getSimpleName().toLowerCase(); String describtion = fn.getDescribtion(locale);
return Inter.getLocText(localeKey); if (describtion.startsWith(CalculatorEmbeddedFunction.LOCALE_PREFIX)) {
// 老的自定义函数兼容, 没有重写getDescribtion
return Locale.CHINA.equals(FRContext.getLocale()) ? fn.getCN() : fn.getEN();
}
return describtion;
} }
@Override @Override

Loading…
Cancel
Save