diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java index b369911bf9..eaff26ba5a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java @@ -9,12 +9,12 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.UrlI18nManager; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.GeneralUtils; +import com.fr.i18n.UrlI18nManager; import com.fr.locale.InterProviderFactory; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; diff --git a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java index bf7dd942d8..4f06b1c56b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java @@ -1,12 +1,11 @@ package com.fr.design.actions.help; import com.fr.design.i18n.Toolkit; -import com.fr.design.i18n.UrlI18nManager; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; import com.fr.general.http.HttpToolbox; +import com.fr.i18n.UrlI18nManager; import com.fr.stable.CommonUtils; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 6f8e737ae5..a5b8fc347e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -10,15 +10,14 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; -import com.fr.design.i18n.UrlI18nManager; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.BrowseUtils; import com.fr.file.filter.ChooseFileFilter; -import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; +import com.fr.i18n.UrlI18nManager; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; diff --git a/designer-base/src/main/java/com/fr/design/i18n/UrlI18nManager.java b/designer-base/src/main/java/com/fr/design/i18n/UrlI18nManager.java deleted file mode 100644 index aa498213eb..0000000000 --- a/designer-base/src/main/java/com/fr/design/i18n/UrlI18nManager.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.fr.design.i18n; - -import com.fr.general.CloudCenter; -import com.fr.general.GeneralContext; -import com.fr.locale.LocaleBundle; -import com.fr.locale.LocaleFiles; -import com.fr.locale.LocaleManager; -import com.fr.locale.impl.FineLocaleManager; -import com.fr.stable.ProductConstants; -import com.fr.stable.StringUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - - -public class UrlI18nManager { - private static final String I18N_URL_PATH = "com/fr/design/i18n/url"; - - private static UrlI18nManager instance = new UrlI18nManager(); - - public static UrlI18nManager getInstance() { - return instance; - } - - private LocaleManager localeManager = FineLocaleManager.create(); - - private UrlI18nManager() { - localeManager.addResource(I18N_URL_PATH); - } - - public String getI18nUrl(String key) { - String i18NUrl = getI18nUrlFromCloudCenter(key); - if (StringUtils.isBlank(i18NUrl)) { - i18NUrl = getI18nUrlFromLocal(key); - } - return i18NUrl; - } - - private String getI18nUrlFromCloudCenter(String key) { - List availableKeys = getCloudCenterAvailableKeys(key); - for (String availableKey : availableKeys) { - String i18NUrl = CloudCenter.getInstance().acquireConf(availableKey); - if (!StringUtils.isBlank(i18NUrl)) { - return i18NUrl; - } - } - return StringUtils.EMPTY; - } - - private List getCloudCenterAvailableKeys(String key) { - List availableKeys = new ArrayList<>(); - availableKeys.add(key + "." + GeneralContext.getLocale() + "." + ProductConstants.MAIN_VERSION); - availableKeys.add(key + "." + Locale.ENGLISH + "." + ProductConstants.MAIN_VERSION); - availableKeys.add(key + "." + Locale.CHINA + "." + ProductConstants.MAIN_VERSION); - availableKeys.add(key + "." + GeneralContext.getLocale()); - availableKeys.add(key + "." + Locale.ENGLISH); - availableKeys.add(key + "." + Locale.CHINA); - availableKeys.add(key + "." + ProductConstants.MAIN_VERSION); - availableKeys.add(key); - return availableKeys; - } - - private String getI18nUrlFromLocal(String key) { - List availableLocales = getAvailableLocales(); - LocaleBundle localeBundle = null; - for (Locale availableLocale : availableLocales) { - localeBundle = localeManager.getLocalBundle(availableLocale); - if (isExist(localeBundle, localeManager, key)) { - break; - } - } - if (localeBundle != null) { - return localeBundle.getText(localeManager, key); - } else { - return StringUtils.EMPTY; - } - } - - private List getAvailableLocales() { - List availableLocales = new ArrayList<>(); - availableLocales.add(GeneralContext.getLocale()); - availableLocales.add(Locale.ENGLISH); - availableLocales.add(Locale.CHINA); - return availableLocales; - } - - private boolean isExist(LocaleBundle localeBundle, LocaleManager localeManager, String key) { - List filesList = localeManager.getReverseList(); - for (LocaleFiles files : filesList) { - if (files.contains(localeBundle.getLocale(), key)) { - return true; - } - } - return false; - } -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java index 86021733d0..a8c19c6976 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java @@ -5,11 +5,10 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; -import com.fr.design.i18n.UrlI18nManager; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.CloudCenter; import com.fr.general.IOUtils; +import com.fr.i18n.UrlI18nManager; import javax.swing.BorderFactory; import javax.swing.JDialog; diff --git a/designer-base/src/main/java/com/fr/env/HelpLink.java b/designer-base/src/main/java/com/fr/env/HelpLink.java index b0d5eab328..133a234900 100644 --- a/designer-base/src/main/java/com/fr/env/HelpLink.java +++ b/designer-base/src/main/java/com/fr/env/HelpLink.java @@ -1,8 +1,7 @@ package com.fr.env; -import com.fr.design.i18n.UrlI18nManager; -import com.fr.general.locale.LocaleCenter; -import com.fr.general.locale.LocaleMark; + +import com.fr.i18n.UrlI18nManager; import com.fr.locale.InterProviderFactory; import com.fr.stable.StringUtils; import java.util.HashMap; diff --git a/designer-base/src/main/resources/com/fr/design/i18n/url_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/url_en.properties deleted file mode 100644 index 7f4fafc35c..0000000000 --- a/designer-base/src/main/resources/com/fr/design/i18n/url_en.properties +++ /dev/null @@ -1,7 +0,0 @@ -help=https://help.fanruan.com/finereport-en/ -help.remote.design=https://help.fanruan.com/finereport-en/doc-view-3862.html?source=4 -odbc.help=https://help.fanruan.com/finereport-en/doc-view-289.html -plugin.mobile.style=https://help.fanruan.com/finereport-en/doc-view-2656.html -help.install.font=https://help.fanruan.com/finereport-en/doc-view-3875.html -website=https://www.finereport.com/en/ -nine.point.help=https://help.fanruan.com/finereport-en/doc-view-3876.html \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/url_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/url_ja_JP.properties deleted file mode 100644 index 6d0a960fa6..0000000000 --- a/designer-base/src/main/resources/com/fr/design/i18n/url_ja_JP.properties +++ /dev/null @@ -1,7 +0,0 @@ -help=https://help.fanruan.com/finereport-jp/ -help.remote.design=https://help.fanruan.com/finereport-jp/doc-view-3891.html -odbc.help=https://help.fanruan.com/finereport-jp/doc-view-289.html -plugin.mobile.style=https://help.fanruan.com/finereport-jp/doc-view-2656.html -help.install.font=https://help.fanruan.com/finereport-jp/doc-view-3892.html -website=https://www.finereport.com/jp/ -nine.point.help=https://help.fanruan.com/finereport-jp/doc-view-3896.html \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/url_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/url_ko_KR.properties deleted file mode 100644 index 4078962317..0000000000 --- a/designer-base/src/main/resources/com/fr/design/i18n/url_ko_KR.properties +++ /dev/null @@ -1 +0,0 @@ -website=https://www.finereport.com/kr/ \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/url_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/url_zh.properties deleted file mode 100644 index ef25a7bf89..0000000000 --- a/designer-base/src/main/resources/com/fr/design/i18n/url_zh.properties +++ /dev/null @@ -1,7 +0,0 @@ -help=https://help.fanruan.com/finereport/ -help.remote.design=https://help.fanruan.com/finereport/doc-view-3925.html -odbc.help=https://help.fanruan.com/finereport/doc-view-289.html -plugin.mobile.style=https://help.fanruan.com/finereport/doc-view-2656.html -help.install.font=https://help.fanruan.com/finereport/doc-view-3999.html -website=https://www.finereport.com/ -nine.point.help=https://help.fanruan.com/finereport/doc-view-4135.html \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/url_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/url_zh_TW.properties deleted file mode 100644 index 1a207e9f3f..0000000000 --- a/designer-base/src/main/resources/com/fr/design/i18n/url_zh_TW.properties +++ /dev/null @@ -1,7 +0,0 @@ -help=https://help.fanruan.com/finereport-tw/ -help.remote.design=https://help.fanruan.com/finereport/doc-view-3925.html -odbc.help=https://help.fanruan.com/finereport/doc-view-289.html -plugin.mobile.style=https://help.fanruan.com/finereport/doc-view-2656.html -help.install.font=https://help.fanruan.com/finereport/doc-view-3999.html -website=https://www.finereport.com/tw/ -nine.point.help=https://help.fanruan.com/finereport-tw/doc-view-4519.html \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java index 3d2e86c592..6e8cac0d81 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java @@ -20,7 +20,6 @@ import com.fr.design.gui.ibutton.UIButtonUI; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.UrlI18nManager; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -32,6 +31,7 @@ import com.fr.env.utils.DesignerInteractionHistory; import com.fr.form.ui.LayoutBorderStyle; import com.fr.general.Background; import com.fr.general.IOUtils; +import com.fr.i18n.UrlI18nManager; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; import com.fr.stable.ProjectLibrary; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 759a05ba7f..be598f553c 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -9,7 +9,6 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.fun.ParameterExpandablePaneUIProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.UrlI18nManager; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -22,6 +21,7 @@ import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.general.CloudCenter; +import com.fr.i18n.UrlI18nManager; import com.fr.log.FineLoggerFactory; import com.fr.report.mobile.EmptyMobileParamStyle;