diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index 4d5509c88..6f308ad43 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -13,6 +13,7 @@ import com.teamdev.jxbrowser.chromium.JSValue; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.util.Locale; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -118,7 +119,13 @@ public class VanChartRichEditorPane { } public static String generateTransformI18nJS() { - String language = DesignerEnvManager.getEnvManager().getLanguage().toString(); + String language = "zh_CN"; + + Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); + + if (locale != null) { + language = locale.toString(); + } return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; }