From 0053a8c425ade0d9a26b5a3424d3b7af4212061c Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 23 May 2018 16:20:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/FunctionNAD.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/designer-base/src/com/fr/design/formula/FunctionNAD.java b/designer-base/src/com/fr/design/formula/FunctionNAD.java index 66de7927fb..b461864998 100644 --- a/designer-base/src/com/fr/design/formula/FunctionNAD.java +++ b/designer-base/src/com/fr/design/formula/FunctionNAD.java @@ -1,12 +1,14 @@ 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.script.Function; +import java.util.Locale; + public class FunctionNAD extends AbstractNameAndDescription { - private static final String LOCALE_PREFIX = "Fine-Core_Formula_"; private Function fn; @@ -22,9 +24,14 @@ public class FunctionNAD extends AbstractNameAndDescription { if (fn == null) { return StringUtils.EMPTY; } - // 统一用Fine-Core_Formula_+公式小写名作为国际化的key - String localeKey = LOCALE_PREFIX + fn.getClass().getSimpleName().toLowerCase(); - return Inter.getLocText(localeKey); + Locale locale = FRContext.getLocale(); + String describtion = fn.getDescribtion(locale); + if (describtion.startsWith(CalculatorEmbeddedFunction.LOCALE_PREFIX)) { + // 老的自定义函数兼容, 没有重写getDescribtion + return Locale.CHINA.equals(FRContext.getLocale()) ? fn.getCN() : fn.getEN(); + } + + return describtion; } @Override