From bcf447776f983c9f613473b9c8137a80a3d2bea8 Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 20 Nov 2020 17:13:38 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-41512=20=E5=AD=98=E5=82=A8=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E8=BF=94=E5=9B=9E=E5=A4=9A=E4=B8=AA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=9C=A8fr=E4=B8=AD=E8=B0=83=E7=94=A8=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E8=BF=94=E5=9B=9E=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/ProcedureDataPane.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java index b138f4e58..d0bc499a2 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java @@ -5,6 +5,7 @@ import com.fr.base.StoreProcedureParameter; import com.fr.data.core.db.TableProcedure; import com.fr.data.impl.Connection; import com.fr.data.impl.NameDatabaseConnection; +import com.fr.data.impl.storeproc.ProcedureDataModel; import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.operator.DataOperator; import com.fr.design.actions.UpdateAction; @@ -29,13 +30,19 @@ import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ToolBarDef; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.ConnectionConfig; - -import com.fr.script.Calculator; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JPanel; +import javax.swing.JSplitPane; +import javax.swing.JToolBar; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane imp protected Void doInBackground() throws Exception { DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); sp.setCalculating(true); - sp.creatDataModel(Calculator.createCalculator()); + ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false); + sp.refreshDataModelListAndResultNames(dataModels); return null; } From 5ae02c176ca6cf89402bd50103eefba41c3bd59b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 23 Nov 2020 19:03:48 +0800 Subject: [PATCH 2/4] =?UTF-8?q?CHART-16853=20=E5=A4=84=E7=90=86=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartRichEditorPane.java | 13 ++ .../com/fr/design/editor/rich_editor.html | 19 +-- .../com/fr/design/editor/script/editor.js | 2 +- .../fr/design/editor/script/editor.model.js | 6 +- .../com/fr/design/editor/script/enums.js | 15 +++ .../com/fr/design/editor/script/i18n.js | 123 ++++++++++++++++++ 6 files changed, 157 insertions(+), 21 deletions(-) create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/enums.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js 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 1ccc146c1..4d5509c88 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 @@ -1,7 +1,9 @@ package com.fr.van.chart.designer.component; import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.DesignerEnvManager; import com.fr.design.ui.ModernUIPane; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.type.TextAlign; @@ -63,6 +65,11 @@ public class VanChartRichEditorPane { browser = event.getBrowser(); browser.getCacheStorage().clearCache(); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/fineui.min.js")); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/design/editor/script/i18n.js")); + browser.executeJavaScript(generateTransformI18nJS()); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/materials.min.js")); + JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); ns.asObject().setProperty(variable, model); } @@ -110,6 +117,12 @@ public class VanChartRichEditorPane { return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align); } + public static String generateTransformI18nJS() { + String language = DesignerEnvManager.getEnvManager().getLanguage().toString(); + + return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; + } + public static class RichEditorModel { private String content = StringUtils.EMPTY; private boolean auto = true; diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 07fbb3ec7..e6c769f0a 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -5,26 +5,9 @@ - - - + diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index bb5370e4f..f3e053679 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -52,7 +52,7 @@ type: "bi.htape", items: [{ type: "bi.label", - text: "字体样式: ", + text: BI.i18nText("BI-Design_Font_Style") + ": ", textAlign: "left", width: 70 }, { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js index f430fea6c..c901fd31e 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js @@ -17,8 +17,9 @@ fontStyleItems: function () { return [{ type: "bi.single_select_radio_item", - text: "自动", + text: BI.i18nText("BI-Basic_Auto"), hgap: 5, + width: 50, logic: { dynamic: true }, @@ -26,8 +27,9 @@ selected: this.options.isAuto }, { type: "bi.single_select_radio_item", - text: "自定义", + text: BI.i18nText("BI-Basic_Custom"), hgap: 5, + width: 60, logic: { dynamic: true }, diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js b/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js new file mode 100644 index 000000000..461625ebc --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js @@ -0,0 +1,15 @@ +window.BICst = window.BICst || {}; +BICst.RICH_TEXT_INFO = { + DATA_ID: "data-id", + DATA_NAME: "data-name", + DATA_FULL_NAME: "data-full-name", + DATA_ORIGIN_ID: "data-origin-id", + DATA_ORIGIN_NAME: "data-origin-name", + DATA_ORIGIN_FULL_NAME: "data-origin-full-name", + DATA_IS_INSERT_PARAM: "data-is-insert-param", + DATA_IS_MISSING_FIELD: "data-is-missing-field", + DATA_UN_VALID: "data-unvalid", + NAME: "name", + ALT: "alt", + SRC: "src" +}; \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js new file mode 100644 index 000000000..95b4585c9 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js @@ -0,0 +1,123 @@ +!(function () { + + var chinese = { + "BI-Design_Font_Style": "字体样式", + "BI-Font_Size": "字号", + "BI-Basic_Auto": "自动", + "BI-Basic_Custom": "自定义", + "BI-Basic_Default": "默认", + "BI-Basic_Sim_Hei": "黑体", + "BI-Basic_Sim_Sun": "宋体", + "BI-Basic_Fang_Song": "仿宋", + "BI-Basic_Kai_Ti": "楷体", + "BI-Basic_Bold": "加粗", + "BI-Basic_Italic": "斜体", + "BI-Basic_Underline": "下划线", + "BI-Basic_Font_Color": "文字颜色", + "BI-Word_Align_Left": "文字居左", + "BI-Word_Align_Center": "文字居中", + "BI-Word_Align_Right": "文字居右" + }; + + var taiwan = { + "BI-Design_Font_Style": "字體樣式", + "BI-Font_Size": "字號", + "BI-Basic_Auto": "自動", + "BI-Basic_Custom": "自定義", + "BI-Basic_Default": "默認", + "BI-Basic_Sim_Hei": "黑體", + "BI-Basic_Sim_Sun": "宋體", + "BI-Basic_Fang_Song": "仿宋", + "BI-Basic_Kai_Ti": "楷體", + "BI-Basic_Bold": "加粗", + "BI-Basic_Italic": "斜體", + "BI-Basic_Underline": "下劃線", + "BI-Basic_Font_Color": "文字顏色", + "BI-Word_Align_Left": "文字居左", + "BI-Word_Align_Center": "文字居中", + "BI-Word_Align_Right": "文字居右" + }; + + var english = { + "BI-Design_Font_Style": "Font style", + "BI-Font_Size": "Font size", + "BI-Basic_Auto": "auto", + "BI-Basic_Custom": "custom", + "BI-Basic_Default": "default", + "BI-Basic_Sim_Hei": "Sim_Hei", + "BI-Basic_Sim_Sun": "Sim_Sun", + "BI-Basic_Fang_Song": "Fang_Song", + "BI-Basic_Kai_Ti": "Kai_Ti", + "BI-Basic_Bold": "Bold", + "BI-Basic_Italic": "Italic", + "BI-Basic_Underline": "UnderLine", + "BI-Basic_Font_Color": "Font Color", + "BI-Word_Align_Left": "Align Left", + "BI-Word_Align_Center": "Align Center", + "BI-Word_Align_Right": "Align Right" + }; + + var japanese = { + "BI-Design_Font_Style": "フォントスタイル", + "BI-Font_Size": "フォントサイズ", + "BI-Basic_Auto": "自動", + "BI-Basic_Custom": "カスタマイズ", + "BI-Basic_Default": "デフォルト", + "BI-Basic_Sim_Hei": "黒い体", + "BI-Basic_Sim_Sun": "ソンティ", + "BI-Basic_Fang_Song": "イミテーションソング", + "BI-Basic_Kai_Ti": "イタリック", + "BI-Basic_Bold": "大胆な", + "BI-Basic_Italic": "イタリック", + "BI-Basic_Underline": "アンダースコア", + "BI-Basic_Font_Color": "テキストの色", + "BI-Word_Align_Left": "左のテキスト", + "BI-Word_Align_Center": "テキスト中心", + "BI-Word_Align_Right": "右のテキスト" + }; + + var korean = { + "BI-Design_Font_Style": "글꼴 스타일", + "BI-Font_Size": "글꼴 크기", + "BI-Basic_Auto": "자동적 인", + "BI-Basic_Custom": "맞춤 설정", + "BI-Basic_Default": "기본", + "BI-Basic_Sim_Hei": "블랙 바디", + "BI-Basic_Sim_Sun": "송티", + "BI-Basic_Fang_Song": "모조 노래", + "BI-Basic_Kai_Ti": "기울임 꼴", + "BI-Basic_Bold": "굵게", + "BI-Basic_Italic": "이탤릭체", + "BI-Basic_Underline": "밑줄", + "BI-Basic_Font_Color": "텍스트 색상", + "BI-Word_Align_Left": "왼쪽 텍스트", + "BI-Word_Align_Center": "텍스트 중심", + "BI-Word_Align_Right": "오른쪽 텍스트" + }; + + function transformI18n(language) { + var BI = window.BI; + + if (BI == null) { + return; + } + + if (language == null) { + BI.addI18n(chinese); + } + + if (language.indexOf('zh_TW') > -1) { + BI.addI18n(taiwan); + } else if (language.indexOf('en_US') > -1) { + BI.addI18n(english); + } else if (language.indexOf('ja_JP') > -1) { + BI.addI18n(japanese); + } else if (language.indexOf('ko_KR') > -1) { + BI.addI18n(korean); + } else { + BI.addI18n(chinese); + } + } + + window.transformI18n = transformI18n; +}()); \ No newline at end of file From 38e53e5163b4fd5303058a60324974d03650ca4c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 23 Nov 2020 19:15:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/component/VanChartRichEditorPane.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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'); }());"; } From 67bc9edf4f696df78271488611b86684aec2ffd2 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 23 Nov 2020 19:03:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?CHART-16853=20=E5=A4=84=E7=90=86=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartRichEditorPane.java | 56 +++++++- .../com/fr/design/editor/rich_editor.html | 19 +-- .../com/fr/design/editor/script/editor.js | 2 +- .../fr/design/editor/script/editor.model.js | 6 +- .../com/fr/design/editor/script/enums.js | 15 +++ .../com/fr/design/editor/script/i18n.js | 123 ++++++++++++++++++ 6 files changed, 195 insertions(+), 26 deletions(-) create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/enums.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js 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 622d2a0ee..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 @@ -1,6 +1,10 @@ package com.fr.van.chart.designer.component; +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.DesignerEnvManager; import com.fr.design.ui.ModernUIPane; +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.type.TextAlign; import com.fr.stable.StringUtils; @@ -9,7 +13,10 @@ 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; public class VanChartRichEditorPane { @@ -21,6 +28,25 @@ public class VanChartRichEditorPane { private static ModernUIPane richEditorPane; private static Browser browser; + public static void initRichEditorPane() { + ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(new NamedThreadFactory("VanChartRichEditor")); + + try { + singleThreadExecutor.submit(new Runnable() { + @Override + public void run() { + try { + richEditorPane = initPane(new RichEditorModel()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }); + } finally { + singleThreadExecutor.shutdown(); + } + } + public static ModernUIPane createRichEditorPane(AttrTooltipRichText richEditor) { RichEditorModel model = getRichEditorModel(richEditor); @@ -40,6 +66,11 @@ public class VanChartRichEditorPane { browser = event.getBrowser(); browser.getCacheStorage().clearCache(); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/fineui.min.js")); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/design/editor/script/i18n.js")); + browser.executeJavaScript(generateTransformI18nJS()); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/materials.min.js")); + JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); ns.asObject().setProperty(variable, model); } @@ -87,12 +118,27 @@ public class VanChartRichEditorPane { return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align); } + public static String generateTransformI18nJS() { + String language = "zh_CN"; + + Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); + + if (locale != null) { + language = locale.toString(); + } + + return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; + } + public static class RichEditorModel { - private String content; - private boolean auto; - private String params; - private String initParams; - private String align; + private String content = StringUtils.EMPTY; + private boolean auto = true; + private String params = StringUtils.EMPTY; + private String initParams = StringUtils.EMPTY; + private String align = TextAlign.LEFT.getAlign(); + + public RichEditorModel() { + } public RichEditorModel(String content, boolean auto, String params, String initParams, String align) { this.content = content; diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 07fbb3ec7..e6c769f0a 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -5,26 +5,9 @@ - - - + diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index bb5370e4f..f3e053679 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -52,7 +52,7 @@ type: "bi.htape", items: [{ type: "bi.label", - text: "字体样式: ", + text: BI.i18nText("BI-Design_Font_Style") + ": ", textAlign: "left", width: 70 }, { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js index f430fea6c..c901fd31e 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js @@ -17,8 +17,9 @@ fontStyleItems: function () { return [{ type: "bi.single_select_radio_item", - text: "自动", + text: BI.i18nText("BI-Basic_Auto"), hgap: 5, + width: 50, logic: { dynamic: true }, @@ -26,8 +27,9 @@ selected: this.options.isAuto }, { type: "bi.single_select_radio_item", - text: "自定义", + text: BI.i18nText("BI-Basic_Custom"), hgap: 5, + width: 60, logic: { dynamic: true }, diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js b/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js new file mode 100644 index 000000000..461625ebc --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js @@ -0,0 +1,15 @@ +window.BICst = window.BICst || {}; +BICst.RICH_TEXT_INFO = { + DATA_ID: "data-id", + DATA_NAME: "data-name", + DATA_FULL_NAME: "data-full-name", + DATA_ORIGIN_ID: "data-origin-id", + DATA_ORIGIN_NAME: "data-origin-name", + DATA_ORIGIN_FULL_NAME: "data-origin-full-name", + DATA_IS_INSERT_PARAM: "data-is-insert-param", + DATA_IS_MISSING_FIELD: "data-is-missing-field", + DATA_UN_VALID: "data-unvalid", + NAME: "name", + ALT: "alt", + SRC: "src" +}; \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js new file mode 100644 index 000000000..95b4585c9 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js @@ -0,0 +1,123 @@ +!(function () { + + var chinese = { + "BI-Design_Font_Style": "字体样式", + "BI-Font_Size": "字号", + "BI-Basic_Auto": "自动", + "BI-Basic_Custom": "自定义", + "BI-Basic_Default": "默认", + "BI-Basic_Sim_Hei": "黑体", + "BI-Basic_Sim_Sun": "宋体", + "BI-Basic_Fang_Song": "仿宋", + "BI-Basic_Kai_Ti": "楷体", + "BI-Basic_Bold": "加粗", + "BI-Basic_Italic": "斜体", + "BI-Basic_Underline": "下划线", + "BI-Basic_Font_Color": "文字颜色", + "BI-Word_Align_Left": "文字居左", + "BI-Word_Align_Center": "文字居中", + "BI-Word_Align_Right": "文字居右" + }; + + var taiwan = { + "BI-Design_Font_Style": "字體樣式", + "BI-Font_Size": "字號", + "BI-Basic_Auto": "自動", + "BI-Basic_Custom": "自定義", + "BI-Basic_Default": "默認", + "BI-Basic_Sim_Hei": "黑體", + "BI-Basic_Sim_Sun": "宋體", + "BI-Basic_Fang_Song": "仿宋", + "BI-Basic_Kai_Ti": "楷體", + "BI-Basic_Bold": "加粗", + "BI-Basic_Italic": "斜體", + "BI-Basic_Underline": "下劃線", + "BI-Basic_Font_Color": "文字顏色", + "BI-Word_Align_Left": "文字居左", + "BI-Word_Align_Center": "文字居中", + "BI-Word_Align_Right": "文字居右" + }; + + var english = { + "BI-Design_Font_Style": "Font style", + "BI-Font_Size": "Font size", + "BI-Basic_Auto": "auto", + "BI-Basic_Custom": "custom", + "BI-Basic_Default": "default", + "BI-Basic_Sim_Hei": "Sim_Hei", + "BI-Basic_Sim_Sun": "Sim_Sun", + "BI-Basic_Fang_Song": "Fang_Song", + "BI-Basic_Kai_Ti": "Kai_Ti", + "BI-Basic_Bold": "Bold", + "BI-Basic_Italic": "Italic", + "BI-Basic_Underline": "UnderLine", + "BI-Basic_Font_Color": "Font Color", + "BI-Word_Align_Left": "Align Left", + "BI-Word_Align_Center": "Align Center", + "BI-Word_Align_Right": "Align Right" + }; + + var japanese = { + "BI-Design_Font_Style": "フォントスタイル", + "BI-Font_Size": "フォントサイズ", + "BI-Basic_Auto": "自動", + "BI-Basic_Custom": "カスタマイズ", + "BI-Basic_Default": "デフォルト", + "BI-Basic_Sim_Hei": "黒い体", + "BI-Basic_Sim_Sun": "ソンティ", + "BI-Basic_Fang_Song": "イミテーションソング", + "BI-Basic_Kai_Ti": "イタリック", + "BI-Basic_Bold": "大胆な", + "BI-Basic_Italic": "イタリック", + "BI-Basic_Underline": "アンダースコア", + "BI-Basic_Font_Color": "テキストの色", + "BI-Word_Align_Left": "左のテキスト", + "BI-Word_Align_Center": "テキスト中心", + "BI-Word_Align_Right": "右のテキスト" + }; + + var korean = { + "BI-Design_Font_Style": "글꼴 스타일", + "BI-Font_Size": "글꼴 크기", + "BI-Basic_Auto": "자동적 인", + "BI-Basic_Custom": "맞춤 설정", + "BI-Basic_Default": "기본", + "BI-Basic_Sim_Hei": "블랙 바디", + "BI-Basic_Sim_Sun": "송티", + "BI-Basic_Fang_Song": "모조 노래", + "BI-Basic_Kai_Ti": "기울임 꼴", + "BI-Basic_Bold": "굵게", + "BI-Basic_Italic": "이탤릭체", + "BI-Basic_Underline": "밑줄", + "BI-Basic_Font_Color": "텍스트 색상", + "BI-Word_Align_Left": "왼쪽 텍스트", + "BI-Word_Align_Center": "텍스트 중심", + "BI-Word_Align_Right": "오른쪽 텍스트" + }; + + function transformI18n(language) { + var BI = window.BI; + + if (BI == null) { + return; + } + + if (language == null) { + BI.addI18n(chinese); + } + + if (language.indexOf('zh_TW') > -1) { + BI.addI18n(taiwan); + } else if (language.indexOf('en_US') > -1) { + BI.addI18n(english); + } else if (language.indexOf('ja_JP') > -1) { + BI.addI18n(japanese); + } else if (language.indexOf('ko_KR') > -1) { + BI.addI18n(korean); + } else { + BI.addI18n(chinese); + } + } + + window.transformI18n = transformI18n; +}()); \ No newline at end of file