From 23b833b9d5735501d812b83012126eee807126d8 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 13 Feb 2017 10:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20SiteCenter=20=E5=8F=96?= =?UTF-8?q?=E5=80=BC=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/actions/help/AboutPane.java | 12 ++---------- .../fr/design/actions/help/TutorialAction.java | 15 ++++----------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/help/AboutPane.java b/designer_base/src/com/fr/design/actions/help/AboutPane.java index c16f2047b..5ee395f80 100644 --- a/designer_base/src/com/fr/design/actions/help/AboutPane.java +++ b/designer_base/src/com/fr/design/actions/help/AboutPane.java @@ -80,16 +80,8 @@ public class AboutPane extends JPanel { contentPane.add(boxCenterAlignmentPane); } - String locale; // SiteCenter 取值的 key 后缀 - if (FRContext.getLocale().equals(Locale.US)) { - locale = ".en"; - } else if (FRContext.getLocale().equals(Locale.JAPAN)) { - locale = ".jp"; - } else { - locale = ""; - } - BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website" + locale, ProductConstants.WEBSITE_URL)); - BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("register.email", ProductConstants.SUPPORT_EMAIL)); + BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL)); + BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL)); contentPane.add(actionLabel); contentPane.add(emailLabel); diff --git a/designer_base/src/com/fr/design/actions/help/TutorialAction.java b/designer_base/src/com/fr/design/actions/help/TutorialAction.java index c62ad0026..8ae2b2962 100644 --- a/designer_base/src/com/fr/design/actions/help/TutorialAction.java +++ b/designer_base/src/com/fr/design/actions/help/TutorialAction.java @@ -59,20 +59,13 @@ public class TutorialAction extends UpdateAction { * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { - Locale locale = FRContext.getLocale(); - String helpKey = ""; + String helpURL = SiteCenter.getInstance().acquireUrlByKind("help." + FRContext.getLocale()); - 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 (helpURL != null) { + HttpClient client = new HttpClient(helpURL); if(client.getResponseCode() != -1) { try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind(helpKey))); + Desktop.getDesktop().browse(new URI(helpURL)); return; } catch (Exception e) { //出了异常的话, 依然打开本地教程