|
|
@ -1,12 +1,15 @@ |
|
|
|
package com.fr.design.formula; |
|
|
|
package com.fr.design.formula; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
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 Function fn; |
|
|
|
private Function fn; |
|
|
|
|
|
|
|
|
|
|
|
FunctionNAD(Function fn) { |
|
|
|
FunctionNAD(Function fn) { |
|
|
@ -20,13 +23,15 @@ public class FunctionNAD extends AbstractNameAndDescription { |
|
|
|
public String getDesc() { |
|
|
|
public String getDesc() { |
|
|
|
if (fn == null) { |
|
|
|
if (fn == null) { |
|
|
|
return StringUtils.EMPTY; |
|
|
|
return StringUtils.EMPTY; |
|
|
|
} else { |
|
|
|
|
|
|
|
if (Locale.CHINA.equals(FRContext.getLocale())) { |
|
|
|
|
|
|
|
return fn.getCN(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return fn.getEN(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Locale locale = FRContext.getLocale(); |
|
|
|
|
|
|
|
String describtion = fn.getDescribtion(locale); |
|
|
|
|
|
|
|
if (describtion.startsWith(CalculatorEmbeddedFunction.LOCALE_PREFIX)) { |
|
|
|
|
|
|
|
// 老的自定义函数兼容, 没有重写getDescribtion
|
|
|
|
|
|
|
|
return Locale.CHINA.equals(locale) ? fn.getCN() : fn.getEN(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return describtion; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|