From f91b63334ce4d1bbdd9daf473079e96e96187e11 Mon Sep 17 00:00:00 2001 From: Honfika Date: Fri, 3 Jan 2014 15:08:24 +0100 Subject: [PATCH] missing localizations --- .../defaultsyntaxkit/config_fr.properties | 4 +- .../jsyntaxpane/Bundle_fr.properties | 6 +- trunk/nbproject/ide-file-targets.xml | 2 +- .../decompiler/flash/abc/ScriptPack.java | 20 +++--- .../flash/gui/AdvancedSettingsDialog.form | 41 ++++-------- .../flash/gui/AdvancedSettingsDialog.java | 63 ++++++++++--------- .../locales/AdvancedSettingsDialog.properties | 4 ++ .../AdvancedSettingsDialog_hu.properties | 4 ++ .../flash/gui/locales/MainFrame.properties | 17 +++++ .../flash/gui/locales/MainFrame_hu.properties | 18 ++++++ trunk/src/com/jpexs/helpers/Helper.java | 19 ++++-- 11 files changed, 122 insertions(+), 76 deletions(-) diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config_fr.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config_fr.properties index 0ea61fbc5..7a8d10ee9 100644 --- a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config_fr.properties +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config_fr.properties @@ -9,8 +9,8 @@ Action.find-next.MenuText = Chercher l'occurence suivante Action.find-next.ToolTip = R\u00e9p\u00e9ter la derni\u00e8re recherche Action.goto-line.MenuText = Aller \u00e0 la ligne n\u00ba Action.goto-line.ToolTip = Aller \u00e0 la ligne n\u00ba -Action.indent.MenuText = Augmenter l'indentation -Action.unindent.MenuText = R\u00e9duire l'indentation +Action.indent.MenuText = Augmenter le retrait +Action.unindent.MenuText = Diminuer le retrait Action.undo.MenuText = Annuler Action.redo.MenuText = R\u00e9p\u00e9ter Action.delete-lines.MenuText = Effacer la (les) ligne(s) diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane/Bundle_fr.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane/Bundle_fr.properties index c5c5c319a..bc2017132 100644 --- a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane/Bundle_fr.properties +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane/Bundle_fr.properties @@ -8,10 +8,10 @@ HTMLPreviewFrame.title=Aper HTMLPreviewFrame.jEdtHtml.contentType=text/html QuickFindDialog.jChkWrap.text=Wrap QuickFindDialog.jChkRegExp.text=Reg Exp -QuickFindDialog.jChkIgnoreCase.text=Ignorer la Casse +QuickFindDialog.jChkIgnoreCase.text=Ignorer la casse QuickFindDialog.jLabel1.text=Recherche rapide QuickFindDialog.NotFound=non trouv\u00E9 -ReplaceDialog.jChkRegex.text=Regular Expression +ReplaceDialog.jChkRegex.text=Mot entier ReplaceDialog.jChkIgnoreCase.text=Ignorer la Casse ReplaceDialog.jLblReplace.text=Remplacer ReplaceDialog.jTglHighlight.text=Surligner @@ -27,7 +27,7 @@ ShowAbbsDialog.title=Abr\u00E9viations GotoLineDialog.title=Aller \u00E0 la ligne GotoLineDialog.jBtnOk.text=GO -DocumentSearchData.SearchStringNotFound=La chaine chaine {0} N\u0027a pas \u00E9t\u00E9 trouv\u00E9 +DocumentSearchData.SearchStringNotFound=La chaine chaine {0} Nn\u0027a pas \u00E9t\u00E9 trouv\u00E9 DocumentSearchData.Find=Chercher ScriptAction.NoScriptConfigured=Aucun script configur\u00E9 pour cette action ScriptAction.ErrorInScript=Erreur dans le script diff --git a/trunk/nbproject/ide-file-targets.xml b/trunk/nbproject/ide-file-targets.xml index e76453db8..4c9f4def9 100644 --- a/trunk/nbproject/ide-file-targets.xml +++ b/trunk/nbproject/ide-file-targets.xml @@ -13,7 +13,7 @@ - + diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 564155484..149bf440a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.helpers.FileTextWriter; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; @@ -156,20 +157,25 @@ public class ScriptPack implements TreeElementItem { writer.continueMeasure(); Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", ex); writer.appendNoHilight("/*").newLine(); - writer.appendNoHilight(" * Decompilation error").newLine(); - writer.appendNoHilight(" * Timeout (" + Helper.formatTimeToText(Configuration.decompilationTimeoutFile.get()) + ") was reached").newLine(); + writer.appendNoHilight(" * ").appendNoHilight(AppStrings.translate("decompilationError")).newLine(); + writer.appendNoHilight(" * ").appendNoHilight(String.format(AppStrings.translate("decompilationError.timeout"), Helper.formatTimeToText(Configuration.decompilationTimeoutFile.get()))).newLine(); writer.appendNoHilight(" */").newLine(); - writer.appendNoHilight("throw new IllegalOperationError(\"Not decompiled due to timeout\");").newLine(); + writer.appendNoHilight("throw new IllegalOperationError(\""). + appendNoHilight(AppStrings.translate("decompilationError.timeout.description")). + appendNoHilight("\");").newLine(); return; } catch (ExecutionException ex) { writer.continueMeasure(); Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", ex); writer.appendNoHilight("/*").newLine(); - writer.appendNoHilight(" * Decompilation error").newLine(); - writer.appendNoHilight(" * Code may be obfuscated").newLine(); - writer.appendNoHilight(" * Error type: " + ex.getClass().getSimpleName()).newLine(); + writer.appendNoHilight(" * ").appendNoHilight(AppStrings.translate("decompilationError")).newLine(); + writer.appendNoHilight(" * ").appendNoHilight(AppStrings.translate("decompilationError.obfuscated")).newLine(); + writer.appendNoHilight(" * ").appendNoHilight(AppStrings.translate("decompilationError.errorType")). + appendNoHilight(": " + ex.getClass().getSimpleName()).newLine(); writer.appendNoHilight(" */").newLine(); - writer.appendNoHilight("throw new IllegalOperationError(\"Not decompiled due to error\");").newLine(); + writer.appendNoHilight("throw new IllegalOperationError(\""). + appendNoHilight(AppStrings.translate("decompilationError.error.description")). + appendNoHilight("\");").newLine(); return; } writer.continueMeasure(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.form b/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.form index eb7c75a3a..94604ecf0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.form +++ b/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.form @@ -72,33 +72,8 @@ - - - - - -
-
- - - - - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> - <Connection component="configurationTable" name="cellEditor" type="property"/> - </Editor> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - </TableColumnModel> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="getModel()" type="code"/> </Property> <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> <TableHeader reorderingAllowed="true" resizingAllowed="true"/> @@ -109,7 +84,9 @@ </Container> <Component class="javax.swing.JButton" name="btnOk"> <Properties> - <Property name="text" type="java.lang.String" value="OK"/> + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> + <ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.ok" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/> + </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOkActionPerformed"/> @@ -117,7 +94,9 @@ </Component> <Component class="javax.swing.JButton" name="btnCancel"> <Properties> - <Property name="text" type="java.lang.String" value="Cancel"/> + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> + <ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.cancel" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/> + </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/> @@ -125,7 +104,9 @@ </Component> <Component class="javax.swing.JButton" name="btnReset"> <Properties> - <Property name="text" type="java.lang.String" value="Reset"/> + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> + <ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.reset" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/> + </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnResetActionPerformed"/> diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java b/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java index e009151c5..a74e99a7c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java @@ -47,6 +47,7 @@ public class AdvancedSettingsDialog extends AppDialog { String[] keys = new String[fields.size()]; keys = fields.keySet().toArray(keys); Arrays.sort(keys); + for (String name : keys) { Field field = fields.get(name); DefaultTableModel model = (DefaultTableModel) configurationTable.getModel(); @@ -58,7 +59,7 @@ public class AdvancedSettingsDialog extends AppDialog { } Object defaultValue = Configuration.getDefaultValue(field); if (defaultValue != null) { - description += " (default: " + defaultValue + ")"; + description += " (" + translate("default") + ": " + defaultValue + ")"; } model.addRow(new Object[]{name, item.get(), description}); } catch (IllegalArgumentException | IllegalAccessException ex) { @@ -68,6 +69,34 @@ public class AdvancedSettingsDialog extends AppDialog { } } + private DefaultTableModel getModel() { + return new javax.swing.table.DefaultTableModel( + new Object [][] { }, + new String [] { + translate("advancedSettings.columns.name"), + translate("advancedSettings.columns.value"), + translate("advancedSettings.columns.description") + } + ) { + Class[] types = new Class [] { + String.class, Object.class, String.class + }; + boolean[] canEdit = new boolean [] { + false, true, false + }; + + @Override + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }; + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -89,47 +118,25 @@ public class AdvancedSettingsDialog extends AppDialog { setModal(true); setPreferredSize(new java.awt.Dimension(600, 400)); - configurationTable.setModel(new javax.swing.table.DefaultTableModel( - new Object [][] { - - }, - new String [] { - "Name", "Value", "Description" - } - ) { - Class[] types = new Class [] { - java.lang.String.class, java.lang.Object.class, java.lang.String.class - }; - boolean[] canEdit = new boolean [] { - false, true, false - }; - - public Class getColumnClass(int columnIndex) { - return types [columnIndex]; - } - - public boolean isCellEditable(int rowIndex, int columnIndex) { - return canEdit [columnIndex]; - } - }); + configurationTable.setModel(getModel()); jScrollPane1.setViewportView(configurationTable); - configurationTable.getColumnModel().getColumn(1).setCellEditor(configurationTable.getCellEditor()); - btnOk.setText("OK"); + java.util.ResourceBundle bundle1 = java.util.ResourceBundle.getBundle("com/jpexs/decompiler/flash/gui/locales/MainFrame"); // NOI18N + btnOk.setText(bundle1.getString("button.ok")); // NOI18N btnOk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnOkActionPerformed(evt); } }); - btnCancel.setText("Cancel"); + btnCancel.setText(bundle1.getString("button.cancel")); // NOI18N btnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelActionPerformed(evt); } }); - btnReset.setText("Reset"); + btnReset.setText(bundle1.getString("button.reset")); // NOI18N btnReset.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnResetActionPerformed(evt); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index b024d98a4..6923ca234 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -15,3 +15,7 @@ advancedSettings.dialog.title = Advanced Settings advancedSettings.restartConfirmation = You must restart the program for some modifications to take effect. Do you want to restart it now? +advancedSettings.columns.name = Name +advancedSettings.columns.value = Value +advancedSettings.columns.description = Description +default = default \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties index 0f8e5767f..b70af9154 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties @@ -15,3 +15,7 @@ advancedSettings.dialog.title = Halad\u00f3 be\u00e1ll\u00edt\u00e1sok advancedSettings.restartConfirmation = N\u00e9h\u00e1ny m\u00f3dos\u00edt\u00e1s \u00e9rv\u00e9nybel\u00e9p\u00e9s\u00e9het a programot \u00fajra kell ind\u00edtani. Szeretn\u00e9 \u00fajraind\u00edtani most? +advancedSettings.columns.name = N\u00e9v +advancedSettings.columns.value = \u00c9rt\u00e9k +advancedSettings.columns.description = Le\u00edr\u00e1s +default = alap\u00e9rt\u00e9k \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 4a2392480..06807443c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -395,5 +395,22 @@ menu.tools.otherTools.clearRecentFiles = Clear recent files fontName.name = Font display name: fontName.copyright = Font copyright: button.preview = Preview +button.reset = Reset errors.info = There are INFORMATIONS in the log. Click to view. errors.warning = There are WARNINGS in the log. Click to view. + +decompilationError = Decompilation error +decompilationError.timeout = Timeout ({0}) was reached +decompilationError.timeout.description = Not decompiled due to timeout +decompilationError.obfuscated = Code may be obfuscated +decompilationError.errorType = Error type +decompilationError.error.description = Not decompiled due to error + +#example: 1 hour and 2 minutes +timeFormat.and = and +timeFormat.hour = hour +timeFormat.hours = hours +timeFormat.minute = minute +timeFormat.minutes = minutes +timeFormat.second = second +timeFormat.seconds = seconds diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties index 7a61d9563..6d1f086a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties @@ -395,5 +395,23 @@ menu.tools.otherTools.clearRecentFiles = El\u0151zm\u00e9nyek t\u00f6rl\u00e9se fontName.name = Bet\u0171t\u00edpus megjelen\u00edtett neve: fontName.copyright = Bet\u0171t\u00edpus szerz\u0151i jog: button.preview = El\u0151n\u00e9zet +button.reset = Alaphelyzetbe \u00e1ll\u00edt errors.info = INFORM\u00c1CI\u00d3K vannak a napl\u00f3ban. Kattintson ide a megjelen\u00edt\u00e9shez. errors.warning = FIGYELMEZTET\u00c9SEK vannak a napl\u00f3ban. Kattintson ide a megjelen\u00edt\u00e9shez. + +decompilationError = Visszaford\u00edt\u00e1si hiba +decompilationError.timeout = Id\u0151t\u00fall\u00e9p\u00e9s ({0}) +decompilationError.timeout.description = Id\u0151t\u00fall\u00e9p\u00e9s miatt nem lett visszaford\u00edtva +decompilationError.obfuscated = K\u00f3d tal\u00e1n obfuszk\u00e1lva van +decompilationError.errorType = Hiba t\u00edpus +decompilationError.error.description = Hiba miatt nem lett visszaford\u00edtva + +#example: 1 hour and 2 minutes +timeFormat.and = \u00e9s +timeFormat.hour = \u00f3ra +timeFormat.hours = \u00f3ra +timeFormat.minute = perc +timeFormat.minutes = perc +timeFormat.second = m\u00e1sodperc +timeFormat.seconds = m\u00e1sodperc + diff --git a/trunk/src/com/jpexs/helpers/Helper.java b/trunk/src/com/jpexs/helpers/Helper.java index 16acab420..127cac7ef 100644 --- a/trunk/src/com/jpexs/helpers/Helper.java +++ b/trunk/src/com/jpexs/helpers/Helper.java @@ -17,6 +17,7 @@ package com.jpexs.helpers; import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.helpers.Freed; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; @@ -561,20 +562,28 @@ public class Helper { timeM %= 60; String timeStr = ""; + String strAnd = AppStrings.translate("timeFormat.and"); + String strHour = AppStrings.translate("timeFormat.hour"); + String strHours = AppStrings.translate("timeFormat.hours"); + String strMinute = AppStrings.translate("timeFormat.minute"); + String strMinutes = AppStrings.translate("timeFormat.minutes"); + String strSecond = AppStrings.translate("timeFormat.second"); + String strSeconds = AppStrings.translate("timeFormat.seconds"); + if (timeH > 0) { - timeStr += timeH + (timeH > 1 ? " hours" : " hour"); + timeStr += timeH + " " + (timeH > 1 ? strHours : strHour); } if (timeM > 0) { if (timeStr.length() > 0) { - timeStr += " and "; + timeStr += " " + strAnd + " "; } - timeStr += timeM + (timeM > 1 ? " minutes" : " minute"); + timeStr += timeM + " " + (timeM > 1 ? strMinutes : strMinute); } if (timeS > 0) { if (timeStr.length() > 0) { - timeStr += " and "; + timeStr += " " + strAnd + " "; } - timeStr += timeS + (timeS > 1 ? " seconds" : " second"); + timeStr += timeS + " " + (timeS > 1 ? strSeconds : strSecond); } // (currently) used only in log, so no localization is required