Browse Source

REPORT-1178 英文国际化——23/23

master
plough 8 years ago
parent
commit
f2a4d48749
  1. 15
      designer_base/src/com/fr/design/actions/help/TutorialAction.java
  2. 3
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

15
designer_base/src/com/fr/design/actions/help/TutorialAction.java

@ -60,17 +60,26 @@ public class TutorialAction extends UpdateAction {
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
Locale locale = FRContext.getLocale(); Locale locale = FRContext.getLocale();
if (ComparatorUtils.equals(locale, Locale.CHINA) || ComparatorUtils.equals(locale, Locale.TAIWAN)){ String helpKey = "";
HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("help"));
if (ComparatorUtils.equals(locale, Locale.CHINA) || ComparatorUtils.equals(locale, Locale.TAIWAN)) {
helpKey = "help";
} else if (ComparatorUtils.equals(locale, Locale.US)) {
helpKey = "help.en";
}
if (!helpKey.isEmpty()) {
HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(helpKey));
if(client.getResponseCode() != -1) { if(client.getResponseCode() != -1) {
try { try {
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("help"))); Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind(helpKey)));
return; return;
} catch (Exception e) { } catch (Exception e) {
//出了异常的话, 依然打开本地教程 //出了异常的话, 依然打开本地教程
} }
} }
} }
if (OperatingSystem.isMacOS()) { if (OperatingSystem.isMacOS()) {
nativeExcuteMacInstallHomePrograms("helptutorial.app"); nativeExcuteMacInstallHomePrograms("helptutorial.app");
} }

3
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -312,9 +312,10 @@ public abstract class ToolBarMenuDock {
public ShortCut[] createHelpShortCuts() { public ShortCut[] createHelpShortCuts() {
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>(); java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new WebDemoAction()); shortCuts.add(new WebDemoAction());
// 英文,把 video 的链接放到 Help 下面 // 英文,把 video 和帮助文档放到 Help 下面
if (FRContext.getLocale().equals(Locale.US)) { if (FRContext.getLocale().equals(Locale.US)) {
shortCuts.add(new VideoAction()); shortCuts.add(new VideoAction());
shortCuts.add(new TutorialAction());
} }
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
//shortCuts.add(new TutorialAction()); //shortCuts.add(new TutorialAction());

Loading…
Cancel
Save