Browse Source

Merge pull request #377 in DESIGN/design from ~HARRISON/design:release/10.0 to release/10.0

* commit 'e340cfa40abe825e62ba833c9a70957ed917675b':
  REPORT-10025 10.0 & 5.0版本依据国际化规范调整国际化内容
final/10.0
Harrison 6 years ago
parent
commit
d077e23761
  1. 4
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 11
      designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java
  3. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java
  4. 11
      designer-base/src/main/java/com/fr/design/widget/EventCreator.java
  5. 5
      designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java

4
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -24,6 +24,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
@ -394,7 +395,8 @@ public class PreferencePane extends BasicPane {
int i = 0; int i = 0;
for (Map.Entry<Locale, String> entry : map.entrySet()) { for (Map.Entry<Locale, String> entry : map.entrySet()) {
keys[i] = entry.getKey(); keys[i] = entry.getKey();
values[i] = com.fr.design.i18n.Toolkit.i18nText(entry.getValue()); // 想要读取到,必需在这里 使用 Inter 才行。
values[i] = Inter.getLocText(entry.getValue());
i++; i++;
} }
UIDictionaryComboBox<Locale> languageComboBox = new UIDictionaryComboBox<>(keys, values); UIDictionaryComboBox<Locale> languageComboBox = new UIDictionaryComboBox<>(keys, values);

11
designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java

@ -6,7 +6,6 @@ import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.ShortCutListenerProvider; import com.fr.design.gui.controlpane.ShortCutListenerProvider;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.general.Inter;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -98,7 +97,7 @@ public abstract class AbstractShortCutFactory {
*/ */
private class RemoveItemAction extends UpdateAction { private class RemoveItemAction extends UpdateAction {
RemoveItemAction() { RemoveItemAction() {
this.setName(Inter.getLocText("FR-Action_Remove")); this.setName(com.fr.design.i18n.Toolkit.i18nText(("Fine-Design_Basic_Action_Remove")));
this.setMnemonic('R'); this.setMnemonic('R');
this.setSmallIcon(BaseUtils this.setSmallIcon(BaseUtils
.readIcon("/com/fr/base/images/cell/control/remove.png")); .readIcon("/com/fr/base/images/cell/control/remove.png"));
@ -115,7 +114,7 @@ public abstract class AbstractShortCutFactory {
*/ */
private class CopyItemAction extends UpdateAction { private class CopyItemAction extends UpdateAction {
CopyItemAction() { CopyItemAction() {
this.setName(Inter.getLocText("FR-Action_Copy")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/m_edit/copy.png")); .readIcon("/com/fr/design/images/m_edit/copy.png"));
@ -132,7 +131,7 @@ public abstract class AbstractShortCutFactory {
*/ */
private class MoveUpItemAction extends UpdateAction { private class MoveUpItemAction extends UpdateAction {
MoveUpItemAction() { MoveUpItemAction() {
this.setName(Inter.getLocText("Utils-Move_Up")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
this.setMnemonic('U'); this.setMnemonic('U');
this.setSmallIcon(BaseUtils this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/up.png")); .readIcon("/com/fr/design/images/control/up.png"));
@ -149,7 +148,7 @@ public abstract class AbstractShortCutFactory {
*/ */
private class MoveDownItemAction extends UpdateAction { private class MoveDownItemAction extends UpdateAction {
MoveDownItemAction() { MoveDownItemAction() {
this.setName(Inter.getLocText("Utils-Move_Down")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
this.setMnemonic('D'); this.setMnemonic('D');
this.setSmallIcon(BaseUtils this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/down.png")); .readIcon("/com/fr/design/images/control/down.png"));
@ -165,7 +164,7 @@ public abstract class AbstractShortCutFactory {
private boolean isAtoZ = false; private boolean isAtoZ = false;
SortItemAction() { SortItemAction() {
this.setName(Inter.getLocText("FR-Action_Sort")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort"));
this.setMnemonic('S'); this.setMnemonic('S');
this.setSmallIcon(BaseUtils this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/sortAsc.png")); .readIcon("/com/fr/design/images/control/sortAsc.png"));

4
designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java

@ -59,7 +59,7 @@ public class OldShortCutFactory extends AbstractShortCutFactory {
public AddItemUpdateAction(NameableCreator[] creators) { public AddItemUpdateAction(NameableCreator[] creators) {
this.creator = creators[0]; this.creator = creators[0];
this.setName(Inter.getLocText("FR-Action_Add")); this.setName(com.fr.design.i18n.Toolkit.i18nText(("Fine-Design_Basic_Action_Add")));
this.setMnemonic('A'); this.setMnemonic('A');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
} }
@ -75,7 +75,7 @@ public class OldShortCutFactory extends AbstractShortCutFactory {
*/ */
private class AddItemMenuDef extends MenuDef { private class AddItemMenuDef extends MenuDef {
AddItemMenuDef(NameableCreator[] creators) { AddItemMenuDef(NameableCreator[] creators) {
this.setName(Inter.getLocText("FR-Action_Add")); this.setName(com.fr.design.i18n.Toolkit.i18nText(("Fine-Design_Basic_Action_Add")));
this.setMnemonic('A'); this.setMnemonic('A');
this.setIconPath("/com/fr/design/images/control/addPopup.png"); this.setIconPath("/com/fr/design/images/control/addPopup.png");
wrapActionListener(creators); wrapActionListener(creators);

11
designer-base/src/main/java/com/fr/design/widget/EventCreator.java

@ -6,10 +6,8 @@ import com.fr.design.gui.controlpane.NameableSelfCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.form.ui.FileEditor;
import com.fr.form.ui.Widget;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
public class EventCreator extends NameableSelfCreator { public class EventCreator extends NameableSelfCreator {
@ -36,11 +34,14 @@ public class EventCreator extends NameableSelfCreator {
} }
/* /*
* richer:国际化事件名称所有需要国际化的事件都应按格式FR-Engine_Event_eventName来进行国际化 * richer:国际化事件名称所有需要国际化的事件都应根据使用的位置
* 按格式 Fine-模块_xx 来进行国际化
*/ */
public static final String switchLang(String eventName) { public static final String switchLang(String eventName) {
try { try {
return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Event_" + eventName); // 通过映射 , 找到相对应的 properties 文件中的 key 值
String localeKey = ReportEngineEventMapping.getLocaleName(eventName);
return com.fr.design.i18n.Toolkit.i18nText(localeKey);
} catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
return eventName; return eventName;

5
designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java

@ -15,6 +15,7 @@ import com.fr.design.form.javascript.FormEmailPane;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.*; import javax.swing.*;
@ -72,7 +73,9 @@ public class EventPropertyTable extends UIListControlPane {
} }
private String switchLang(String eventName) { private String switchLang(String eventName) {
return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Event_" + eventName); // 在 properties 文件中找到相应的 key 值
String localeKey = ReportEngineEventMapping.getLocaleName(eventName);
return com.fr.design.i18n.Toolkit.i18nText(localeKey);
} }
/** /**

Loading…
Cancel
Save