From f91069e783d1f4ae5e028b347809957766322640 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 23 May 2018 15:10:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-8226=20=E9=99=A4=E4=BA=86report?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E5=85=AC=E5=BC=8F,=20=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=85=AC=E5=BC=8F=E6=94=BEcore.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/FunctionNAD.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/designer-base/src/com/fr/design/formula/FunctionNAD.java b/designer-base/src/com/fr/design/formula/FunctionNAD.java index 9a1fc9d4a5..66de7927fb 100644 --- a/designer-base/src/com/fr/design/formula/FunctionNAD.java +++ b/designer-base/src/com/fr/design/formula/FunctionNAD.java @@ -1,12 +1,13 @@ package com.fr.design.formula; -import java.util.Locale; - -import com.fr.base.FRContext; +import com.fr.general.Inter; import com.fr.stable.StringUtils; import com.fr.stable.script.Function; public class FunctionNAD extends AbstractNameAndDescription { + + private static final String LOCALE_PREFIX = "Fine-Core_Formula_"; + private Function fn; FunctionNAD(Function fn) { @@ -20,13 +21,10 @@ public class FunctionNAD extends AbstractNameAndDescription { public String getDesc() { if (fn == null) { return StringUtils.EMPTY; - } else { - if (Locale.CHINA.equals(FRContext.getLocale())) { - return fn.getCN(); - } else { - return fn.getEN(); - } } + // 统一用Fine-Core_Formula_+公式小写名作为国际化的key + String localeKey = LOCALE_PREFIX + fn.getClass().getSimpleName().toLowerCase(); + return Inter.getLocText(localeKey); } @Override 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 2/3] =?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 From db0625962057aac67311eab623dd0dd5a24c9652 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 23 May 2018 16:20:30 +0800 Subject: [PATCH 3/3] 1 --- designer-base/src/com/fr/design/formula/FunctionNAD.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/formula/FunctionNAD.java b/designer-base/src/com/fr/design/formula/FunctionNAD.java index b461864998..ba42265e19 100644 --- a/designer-base/src/com/fr/design/formula/FunctionNAD.java +++ b/designer-base/src/com/fr/design/formula/FunctionNAD.java @@ -28,7 +28,7 @@ public class FunctionNAD extends AbstractNameAndDescription { String describtion = fn.getDescribtion(locale); if (describtion.startsWith(CalculatorEmbeddedFunction.LOCALE_PREFIX)) { // 老的自定义函数兼容, 没有重写getDescribtion - return Locale.CHINA.equals(FRContext.getLocale()) ? fn.getCN() : fn.getEN(); + return Locale.CHINA.equals(locale) ? fn.getCN() : fn.getEN(); } return describtion;