From 8ca6f60ea72b5b9e9ae6f91c05e367c8db80a1ee Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Apr 2020 11:57:37 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-29457=20=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/i18n/DesignI18nImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java b/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java index 6e4fa7d3b..7d5770864 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java +++ b/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java @@ -15,6 +15,11 @@ import java.util.Locale; public class DesignI18nImpl implements DesignI18nProvider { + static { + // GeneralContext上下文 存储本次启动的语言环境 直接使用DesignerEnvManager 会在设置语言环境后 不重启 立即生效 存在问题 + GeneralContext.setLocale(DesignerEnvManager.getEnvManager().getLanguage()); + } + private static DesignI18nImpl instance = new DesignI18nImpl(); public static DesignI18nImpl getInstance() { @@ -30,7 +35,7 @@ public class DesignI18nImpl implements DesignI18nProvider { @Override public String i18nText(String key) { - return localeManager.getLocalBundle(DesignerEnvManager.getEnvManager().getLanguage()).getText(localeManager, key); + return localeManager.getLocalBundle(GeneralContext.getLocale()).getText(localeManager, key); } @Override