Browse Source

移动国际化到Report

master
juhaoyu 8 years ago
parent
commit
36b18654c5
  1. 2
      designer_base/src/com/fr/design/extra/PluginFromStorePane.java
  2. 4
      designer_base/src/com/fr/design/extra/PluginInstalledPane.java
  3. 2
      designer_base/src/com/fr/design/extra/PluginUpdatePane.java
  4. 12
      designer_base/src/com/fr/design/extra/PluginUtils.java
  5. 3
      designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java
  6. 3
      designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  7. 3
      designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java
  8. 3
      designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  9. 3
      designer_base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java
  10. 3
      designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java
  11. 3
      designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java
  12. 3
      designer_base/src/com/fr/design/extra/tradition/callback/UpdateOnlineCallback.java

2
designer_base/src/com/fr/design/extra/PluginFromStorePane.java

@ -179,7 +179,7 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane<List<Plug
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
} }
});
} catch (Exception e1) {

4
designer_base/src/com/fr/design/extra/PluginInstalledPane.java

@ -69,7 +69,7 @@ public class PluginInstalledPane extends PluginAbstractViewPane {
if (result.isSuccess()) {
JOptionPane.showMessageDialog(null, modifyMessage);
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
});
@ -80,7 +80,7 @@ public class PluginInstalledPane extends PluginAbstractViewPane {
if (result.isSuccess()) {
JOptionPane.showMessageDialog(null, modifyMessage);
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null,PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
});

2
designer_base/src/com/fr/design/extra/PluginUpdatePane.java

@ -200,7 +200,7 @@ public class PluginUpdatePane extends PluginAbstractLoadingViewPane<List<PluginV
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
});

12
designer_base/src/com/fr/design/extra/PluginUtils.java

@ -10,6 +10,7 @@ import com.fr.json.JSONObject;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.error.PluginErrorCode;
import com.fr.plugin.view.PluginView;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StableUtils;
@ -30,6 +31,8 @@ import java.util.Map;
*/
public class PluginUtils {
private static final String ERROR_CODE_I18N_PREFIX = "FR-Plugin_Error_";
public static PluginMarker createPluginMarker(String pluginInfo) {
//todo 判空
@ -158,4 +161,13 @@ public class PluginUtils {
}
}
public static String getMessageByErrorCode(PluginErrorCode errorCode) {
return Inter.getLocText(getInterKeyByErrorCode(errorCode));
}
private static String getInterKeyByErrorCode(PluginErrorCode errorCode) {
return ERROR_CODE_I18N_PREFIX + errorCode.getDescription();
}
}

3
designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.PluginUtils;
import com.fr.design.extra.exe.extratask.ExtraPluginTask;
import com.fr.general.Inter;
import com.fr.plugin.manage.control.PluginTaskResult;
@ -30,7 +31,7 @@ public class DownloadCallback extends AbstractPluginTaskCallback {
extraPluginTask.doExtraPluginTask();
} else {
jsCallback.execute("failed");
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

3
designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.PluginUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.error.PluginErrorCode;
@ -51,7 +52,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback));
} else {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

3
designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.PluginUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginMarker;
@ -51,7 +52,7 @@ public class InstallOnlineCallback extends AbstractPluginTaskCallback {
PluginManager.getController().install(pluginMarker, new InstallOnlineCallback(pluginMarker, jsCallback));
} else {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

3
designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.PluginUtils;
import com.fr.general.Inter;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
@ -24,7 +25,7 @@ public class ModifyStatusCallback implements PluginTaskCallback{
String modifyMessage = isActive ? Inter.getLocText("FR-Designer-Plugin_Disabled") : Inter.getLocText("FR-Designer-Plugin_Actived");
JOptionPane.showMessageDialog(null, modifyMessage);
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

3
designer_base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.PluginUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginMarker;
@ -43,7 +44,7 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback {
PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback));
} else {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

3
designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.PluginUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.error.PluginErrorCode;
@ -51,7 +52,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback));
} else {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

3
designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.PluginUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginMarker;
@ -51,7 +52,7 @@ public class UpdateOnlineCallback extends AbstractPluginTaskCallback {
PluginManager.getController().update(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, jsCallback));
} else {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

3
designer_base/src/com/fr/design/extra/tradition/callback/UpdateOnlineCallback.java

@ -1,6 +1,7 @@
package com.fr.design.extra.tradition.callback;
import com.fr.design.extra.PluginStatusCheckCompletePane;
import com.fr.design.extra.PluginUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginMarker;
@ -49,7 +50,7 @@ public class UpdateOnlineCallback implements ProgressCallback {
PluginManager.getController().update(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, pane));
} else {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

Loading…
Cancel
Save