Browse Source

REPORT-60661 国际化url适配

zheng-1641779399395
Henry.Wang 3 years ago
parent
commit
4da049f96b
  1. 2
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  2. 3
      designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java
  3. 3
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  4. 97
      designer-base/src/main/java/com/fr/design/i18n/UrlI18nManager.java
  5. 3
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java
  6. 5
      designer-base/src/main/java/com/fr/env/HelpLink.java
  7. 7
      designer-base/src/main/resources/com/fr/design/i18n/url_en.properties
  8. 7
      designer-base/src/main/resources/com/fr/design/i18n/url_ja_JP.properties
  9. 1
      designer-base/src/main/resources/com/fr/design/i18n/url_ko_KR.properties
  10. 7
      designer-base/src/main/resources/com/fr/design/i18n/url_zh.properties
  11. 7
      designer-base/src/main/resources/com/fr/design/i18n/url_zh_TW.properties
  12. 2
      designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java
  13. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

2
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.ActionLabel;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.UrlI18nManager;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.i18n.UrlI18nManager;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;

3
designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java

@ -1,12 +1,11 @@
package com.fr.design.actions.help; package com.fr.design.actions.help;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.i18n.UrlI18nManager;
import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.login.AbstractDesignerSSO;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.http.HttpToolbox; import com.fr.general.http.HttpToolbox;
import com.fr.i18n.UrlI18nManager;
import com.fr.stable.CommonUtils; import com.fr.stable.CommonUtils;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;

3
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.ipasswordfield.UIPasswordFieldWithFixedLength;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.i18n.UrlI18nManager;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.BrowseUtils;
import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.i18n.UrlI18nManager;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;

97
designer-base/src/main/java/com/fr/design/i18n/UrlI18nManager.java

@ -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<String> availableKeys = getCloudCenterAvailableKeys(key);
for (String availableKey : availableKeys) {
String i18NUrl = CloudCenter.getInstance().acquireConf(availableKey);
if (!StringUtils.isBlank(i18NUrl)) {
return i18NUrl;
}
}
return StringUtils.EMPTY;
}
private List<String> getCloudCenterAvailableKeys(String key) {
List<String> 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<Locale> 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<Locale> getAvailableLocales() {
List<Locale> 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<LocaleFiles> filesList = localeManager.getReverseList();
for (LocaleFiles files : filesList) {
if (files.contains(localeBundle.getLocale(), key)) {
return true;
}
}
return false;
}
}

3
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.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.i18n.UrlI18nManager;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.i18n.UrlI18nManager;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JDialog; import javax.swing.JDialog;

5
designer-base/src/main/java/com/fr/env/HelpLink.java vendored

@ -1,8 +1,7 @@
package com.fr.env; package com.fr.env;
import com.fr.design.i18n.UrlI18nManager;
import com.fr.general.locale.LocaleCenter; import com.fr.i18n.UrlI18nManager;
import com.fr.general.locale.LocaleMark;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.util.HashMap; import java.util.HashMap;

7
designer-base/src/main/resources/com/fr/design/i18n/url_en.properties

@ -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

7
designer-base/src/main/resources/com/fr/design/i18n/url_ja_JP.properties

@ -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

1
designer-base/src/main/resources/com/fr/design/i18n/url_ko_KR.properties

@ -1 +0,0 @@
website=https://www.finereport.com/kr/

7
designer-base/src/main/resources/com/fr/design/i18n/url_zh.properties

@ -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

7
designer-base/src/main/resources/com/fr/design/i18n/url_zh_TW.properties

@ -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

2
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.ibutton.UIColorButton;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.UrlI18nManager;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; 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.form.ui.LayoutBorderStyle;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.i18n.UrlI18nManager;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.GraphDrawHelper; import com.fr.stable.GraphDrawHelper;
import com.fr.stable.ProjectLibrary; import com.fr.stable.ProjectLibrary;

2
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.fun.ParameterExpandablePaneUIProvider;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.UrlI18nManager;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; 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.container.WSortLayout;
import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.form.ui.mobile.MobileParamStyle;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.i18n.UrlI18nManager;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.mobile.EmptyMobileParamStyle; import com.fr.report.mobile.EmptyMobileParamStyle;

Loading…
Cancel
Save