Browse Source

REPORT-10025 10.0 & 5.0版本依据国际化规范调整国际化内容

final/10.0
Harrison 6 years ago
parent
commit
e340cfa40a
  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.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory;
import com.fr.third.apache.log4j.Level;
@ -394,7 +395,8 @@ public class PreferencePane extends BasicPane {
int i = 0;
for (Map.Entry<Locale, String> entry : map.entrySet()) {
keys[i] = entry.getKey();
values[i] = com.fr.design.i18n.Toolkit.i18nText(entry.getValue());
// 想要读取到,必需在这里 使用 Inter 才行。
values[i] = Inter.getLocText(entry.getValue());
i++;
}
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.ShortCutListenerProvider;
import com.fr.design.menu.ShortCut;
import com.fr.general.Inter;
import java.awt.event.ActionEvent;
@ -98,7 +97,7 @@ public abstract class AbstractShortCutFactory {
*/
private class RemoveItemAction extends UpdateAction {
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.setSmallIcon(BaseUtils
.readIcon("/com/fr/base/images/cell/control/remove.png"));
@ -115,7 +114,7 @@ public abstract class AbstractShortCutFactory {
*/
private class CopyItemAction extends UpdateAction {
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.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/m_edit/copy.png"));
@ -132,7 +131,7 @@ public abstract class AbstractShortCutFactory {
*/
private class MoveUpItemAction extends UpdateAction {
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.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/up.png"));
@ -149,7 +148,7 @@ public abstract class AbstractShortCutFactory {
*/
private class MoveDownItemAction extends UpdateAction {
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.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/down.png"));
@ -165,7 +164,7 @@ public abstract class AbstractShortCutFactory {
private boolean isAtoZ = false;
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.setSmallIcon(BaseUtils
.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) {
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.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
}
@ -75,7 +75,7 @@ public class OldShortCutFactory extends AbstractShortCutFactory {
*/
private class AddItemMenuDef extends MenuDef {
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.setIconPath("/com/fr/design/images/control/addPopup.png");
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.ilist.ListModelElement;
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.report.web.util.ReportEngineEventMapping;
import com.fr.stable.Nameable;
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) {
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) {
FRContext.getLogger().error(e.getMessage(), e);
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.general.NameObject;
import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.stable.Nameable;
import javax.swing.*;
@ -72,7 +73,9 @@ public class EventPropertyTable extends UIListControlPane {
}
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