Translation Fixes

This commit is contained in:
Konloch 2021-07-08 18:58:27 -07:00
parent 6868d488eb
commit 743b515f24
39 changed files with 127 additions and 98 deletions

View file

@ -14,6 +14,7 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import org.objectweb.asm.tree.ClassNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
@ -59,7 +60,7 @@ public class SearchBoxPane extends TranslatedVisibleComponent
public static final SearchType[] SEARCH_TYPES = SearchType.values();
public final JCheckBox exact = new TranslatedJCheckBox("Exact", Translation.EXACT);
public final DefaultMutableTreeNode treeRoot = new TranslatedDefaultMutableTreeNode("Results", Translation.RESULTS);
public final TranslatedDefaultMutableTreeNode treeRoot = new TranslatedDefaultMutableTreeNode("Results", Translation.RESULTS);
public final JTree tree;
public final JComboBox typeBox;
@ -126,6 +127,7 @@ public class SearchBoxPane extends TranslatedVisibleComponent
optionPanel.add(search, BorderLayout.SOUTH);
this.tree = new JTree(treeRoot);
treeRoot.setTree((DefaultTreeModel) tree.getModel());
getContentPane().setLayout(new BorderLayout());

View file

@ -112,7 +112,10 @@ public enum Language
//skip translating if the language config is missing the translation key
if(!translationMap.containsKey(text.key))
{
System.err.println("MISSING TRANSLATION KEY: " + text.key);
continue;
}
//update translation text value
text.value = translationMap.get(text.key);

View file

@ -4,6 +4,7 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference
import the.bytecode.club.bytecodeviewer.translation.Translation;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
/**
* @author Konloch
@ -11,7 +12,7 @@ import javax.swing.tree.DefaultMutableTreeNode;
*/
public class TranslatedDefaultMutableTreeNode extends DefaultMutableTreeNode
{
private final TranslatedComponentReference componentReference;
private DefaultTreeModel tree;
public TranslatedDefaultMutableTreeNode(String text, Translation translation)
{
@ -19,17 +20,22 @@ public class TranslatedDefaultMutableTreeNode extends DefaultMutableTreeNode
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
setUserObject(componentReference.value);
if(componentReference.value != null && !componentReference.value.isEmpty())
{
setUserObject(componentReference.value);
if(tree != null)
tree.nodeChanged(this);
}
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
public void setTree(DefaultTreeModel tree)
{
this.tree = tree;
}
}

View file

@ -11,15 +11,13 @@ import javax.swing.*;
*/
public class TranslatedJButton extends JButton
{
private final TranslatedComponentReference componentReference;
public TranslatedJButton(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -27,9 +25,5 @@ public class TranslatedJButton extends JButton
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -29,15 +29,13 @@ import javax.swing.*;
*/
public class TranslatedJCheckBox extends JCheckBox
{
private final TranslatedComponentReference componentReference;
public TranslatedJCheckBox(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -45,9 +43,5 @@ public class TranslatedJCheckBox extends JCheckBox
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -29,15 +29,13 @@ import javax.swing.*;
*/
public class TranslatedJCheckBoxMenuItem extends JCheckBoxMenuItem
{
private final TranslatedComponentReference componentReference;
public TranslatedJCheckBoxMenuItem(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -45,9 +43,5 @@ public class TranslatedJCheckBoxMenuItem extends JCheckBoxMenuItem
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -11,15 +11,13 @@ import javax.swing.*;
*/
public class TranslatedJLabel extends JLabel
{
private final TranslatedComponentReference componentReference;
public TranslatedJLabel(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -27,9 +25,5 @@ public class TranslatedJLabel extends JLabel
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -29,15 +29,13 @@ import javax.swing.*;
*/
public class TranslatedJMenu extends JMenu
{
private final TranslatedComponentReference componentReference;
public TranslatedJMenu(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -45,9 +43,5 @@ public class TranslatedJMenu extends JMenu
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -29,15 +29,13 @@ import javax.swing.*;
*/
public class TranslatedJMenuItem extends JMenuItem
{
private final TranslatedComponentReference componentReference;
public TranslatedJMenuItem(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -45,9 +43,5 @@ public class TranslatedJMenuItem extends JMenuItem
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -29,15 +29,13 @@ import javax.swing.*;
*/
public class TranslatedJRadioButtonMenuItem extends JRadioButtonMenuItem
{
private final TranslatedComponentReference componentReference;
public TranslatedJRadioButtonMenuItem(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -45,9 +43,5 @@ public class TranslatedJRadioButtonMenuItem extends JRadioButtonMenuItem
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -11,15 +11,13 @@ import javax.swing.*;
*/
public class TranslatedJTextField extends JTextField
{
private final TranslatedComponentReference componentReference;
public TranslatedJTextField(String text, Translation translation)
{
super(text);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -27,9 +25,5 @@ public class TranslatedJTextField extends JTextField
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -10,15 +10,13 @@ import the.bytecode.club.bytecodeviewer.translation.Translation;
*/
public class TranslatedVisibleComponent extends VisibleComponent
{
private final TranslatedComponentReference componentReference;
public TranslatedVisibleComponent(String title, Translation translation)
{
super(title);
if(translation != null)
{
componentReference = translation.getTranslatedComponentReference();
TranslatedComponentReference componentReference = translation.getTranslatedComponentReference();
componentReference.runOnUpdate.add(()->
{
if(componentReference.value != null && !componentReference.value.isEmpty())
@ -26,9 +24,5 @@ public class TranslatedVisibleComponent extends VisibleComponent
});
componentReference.translate();
}
else
{
componentReference = null;
}
}
}

View file

@ -108,5 +108,7 @@
"SUGGESTED_FIX_COMPILER_ERROR": "الإصلاح المقترح: جرب View> Pane> Krakatau> Bytecode وتمكين التحرير.",
"SEARCH_REGEX": "البحث في Regex:",
"NEW_JAVASCRIPT_PLUGIN": "البرنامج المساعد الجديد لجافا سكريبت",
"NEW_JAVA_PLUGIN": "البرنامج المساعد الجديد جافا"
"NEW_JAVA_PLUGIN": "البرنامج المساعد الجديد جافا",
"SAVE_AS": "حفظ باسم ...",
"SAVE": "يحفظ..."
}

View file

@ -122,5 +122,8 @@
"OWNER": "Owner: ",
"NAME": "Name: ",
"DESC": "Desc: ",
"SAVE": "Save...",
"SAVE_AS": "Save As...",
"RESULTS": "Results",
"REFRESH": "Refresh"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "بارگیری مجدد منابع",
"SAVE_AS_DEX": "ذخیره به عنوان DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "پلاگین Javascript جدید",
"NEW_JAVA_PLUGIN": "پلاگین جاوا جدید"
"NEW_JAVA_PLUGIN": "پلاگین جاوا جدید",
"SAVE_AS": "ذخیره به عنوان...",
"SAVE": "صرفه جویی...",
"RESULTS": "نتایج"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Lataa resurssit uudelleen",
"SAVE_AS_DEX": "Tallenna nimellä DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Uusi Javascript-laajennus",
"NEW_JAVA_PLUGIN": "Uusi Java-laajennus"
"NEW_JAVA_PLUGIN": "Uusi Java-laajennus",
"SAVE_AS": "Tallenna nimellä...",
"SAVE": "Tallentaa...",
"RESULTS": "Tulokset"
}

View file

@ -108,5 +108,7 @@
"SUGGESTED_FIX_COMPILER_ERROR": "Solution suggérée : essayez Affichage > Volet > Krakatau > Bytecode et activez Modifiable.",
"SEARCH_REGEX": "Rechercher une expression régulière :",
"NEW_JAVASCRIPT_PLUGIN": "Nouveau plugin Javascript",
"NEW_JAVA_PLUGIN": "Nouveau plugin Java"
"NEW_JAVA_PLUGIN": "Nouveau plugin Java",
"SAVE_AS": "Enregistrer sous...",
"SAVE": "Sauvegarder..."
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "გადატვირთეთ რესურსები",
"SAVE_AS_DEX": "შეინახეთ როგორც DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "ახალი Javascript მოდული",
"NEW_JAVA_PLUGIN": "ახალი ჯავა მოდული"
"NEW_JAVA_PLUGIN": "ახალი ჯავა მოდული",
"SAVE_AS": "Შეინახე როგორც...",
"SAVE": "Გადარჩენა...",
"RESULTS": "შედეგები"
}

View file

@ -108,5 +108,7 @@
"NAME": "Name: ",
"SEARCH_REGEX": "Regex suchen: ",
"NEW_JAVASCRIPT_PLUGIN": "Neues Javascript-Plugin",
"NEW_JAVA_PLUGIN": "Neues Java-Plugin"
"NEW_JAVA_PLUGIN": "Neues Java-Plugin",
"SAVE_AS": "Speichern als...",
"SAVE": "Speichern..."
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Επαναφόρτωση πόρων",
"SAVE_AS_DEX": "Αποθήκευση ως DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Νέα προσθήκη Javascript",
"NEW_JAVA_PLUGIN": "Νέα προσθήκη Java"
"NEW_JAVA_PLUGIN": "Νέα προσθήκη Java",
"SAVE_AS": "Αποθήκευση ως...",
"SAVE": "Σώσει...",
"RESULTS": "Αποτελέσματα"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Sake shigar da Albarkatu",
"SAVE_AS_DEX": "Ajiye As DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Sabon Javascript Plugin",
"NEW_JAVA_PLUGIN": "Sabon fulogin Java"
"NEW_JAVA_PLUGIN": "Sabon fulogin Java",
"SAVE_AS": "Ajiye Kamar ...",
"SAVE": "Ajiye ...",
"RESULTS": "Sakamako"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "טען משאבים מחדש",
"SAVE_AS_DEX": "שמור כ- DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "תוסף Javascript חדש",
"NEW_JAVA_PLUGIN": "תוסף Java חדש"
"NEW_JAVA_PLUGIN": "תוסף Java חדש",
"SAVE_AS": "שמור כ...",
"SAVE": "להציל...",
"RESULTS": "תוצאות"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Erőforrások újratöltése",
"SAVE_AS_DEX": "Mentés DEX néven ...",
"NEW_JAVASCRIPT_PLUGIN": "Új Javascript beépülő modul",
"NEW_JAVA_PLUGIN": "Új Java beépülő modul"
"NEW_JAVA_PLUGIN": "Új Java beépülő modul",
"SAVE_AS": "Mentés másként...",
"SAVE": "Mentés...",
"RESULTS": "Eredmények"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Muat Ulang Sumber Daya",
"SAVE_AS_DEX": "Simpan Sebagai DEX...",
"NEW_JAVASCRIPT_PLUGIN": "Plugin Javascript baru",
"NEW_JAVA_PLUGIN": "Plugin Java Baru"
"NEW_JAVA_PLUGIN": "Plugin Java Baru",
"SAVE_AS": "Simpan Sebagai...",
"SAVE": "Menyimpan...",
"RESULTS": "Hasil"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Ricarica risorse",
"SAVE_AS_DEX": "Salva come DEX...",
"NEW_JAVASCRIPT_PLUGIN": "Nuovo plugin Javascript",
"NEW_JAVA_PLUGIN": "Nuovo plugin Java"
"NEW_JAVA_PLUGIN": "Nuovo plugin Java",
"SAVE_AS": "Salva come...",
"SAVE": "Salva...",
"RESULTS": "Risultati"
}

View file

@ -108,5 +108,7 @@
"SUGGESTED_FIX_COMPILER_ERROR": "推奨される修正:[表示]> [ペイン]> [Krakatau]> [バイトコード]を試して、[編集可能]を有効にします。",
"SEARCH_REGEX": "正規表現の検索:",
"NEW_JAVASCRIPT_PLUGIN": "新しいJavascriptプラグイン",
"NEW_JAVA_PLUGIN": "新しいJavaプラグイン"
"NEW_JAVA_PLUGIN": "新しいJavaプラグイン",
"SAVE_AS": "名前を付けて保存...",
"SAVE": "セーブ..."
}

View file

@ -108,5 +108,7 @@
"SUGGESTED_FIX_COMPILER_ERROR": "Pembaikan yang Disarankan: Cuba Lihat> Panel> Krakatau> Bytecode dan aktifkan Editable.",
"SEARCH_REGEX": "Cari Regex: ",
"NEW_JAVASCRIPT_PLUGIN": "Plugin Javascript Baru",
"NEW_JAVA_PLUGIN": "Plugin Java Baru"
"NEW_JAVA_PLUGIN": "Plugin Java Baru",
"SAVE_AS": "Simpan sebagai...",
"SAVE": "Jimat ..."
}

View file

@ -108,5 +108,7 @@
"DESC": "描述:",
"NAME": "名称:",
"SEARCH_REGEX": "搜索正则表达式:",
"NEW_JAVA_PLUGIN": "新的 Java 插件"
"NEW_JAVA_PLUGIN": "新的 Java 插件",
"SAVE_AS": "另存为...",
"SAVE": "保存..."
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Herlaad bronnen",
"SAVE_AS_DEX": "Opslaan als DEX...",
"NEW_JAVASCRIPT_PLUGIN": "Nieuwe Javascript-plug-in",
"NEW_JAVA_PLUGIN": "Nieuwe Java-plug-in"
"NEW_JAVA_PLUGIN": "Nieuwe Java-plug-in",
"SAVE_AS": "Opslaan als...",
"SAVE": "Sparen...",
"RESULTS": "Resultaten"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Last inn ressurser på nytt",
"SAVE_AS_DEX": "Lagre som DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Ny Javascript-plugin",
"NEW_JAVA_PLUGIN": "Ny Java-plugin"
"NEW_JAVA_PLUGIN": "Ny Java-plugin",
"SAVE_AS": "Lagre som...",
"SAVE": "Lagre...",
"RESULTS": "Resultater"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Przeładuj zasoby",
"SAVE_AS_DEX": "Zapisz jako DEX...",
"NEW_JAVASCRIPT_PLUGIN": "Nowa wtyczka JavaScript",
"NEW_JAVA_PLUGIN": "Nowa wtyczka Java"
"NEW_JAVA_PLUGIN": "Nowa wtyczka Java",
"SAVE_AS": "Zapisz jako...",
"SAVE": "Zapisać...",
"RESULTS": "Wyniki"
}

View file

@ -108,5 +108,7 @@
"SUGGESTED_FIX_COMPILER_ERROR": "Correção sugerida: tente Exibir> Painel> Krakatau> Bytecode e habilite Editável.",
"SEARCH_REGEX": "Pesquisar Regex: ",
"NEW_JAVASCRIPT_PLUGIN": "Novo plugin Javascript",
"NEW_JAVA_PLUGIN": "Novo plugin Java"
"NEW_JAVA_PLUGIN": "Novo plugin Java",
"SAVE_AS": "Salvar como...",
"SAVE": "Salve ..."
}

View file

@ -108,5 +108,7 @@
"SUGGESTED_FIX_COMPILER_ERROR": "Предлагаемое исправление: попробуйте «Просмотр»> «Панель»> «Кракатау»> «Байт-код» и включите «Редактируемый».",
"SEARCH_REGEX": "Искать Regex: ",
"NEW_JAVASCRIPT_PLUGIN": "Новый плагин Javascript",
"NEW_JAVA_PLUGIN": "Новый плагин Java"
"NEW_JAVA_PLUGIN": "Новый плагин Java",
"SAVE_AS": "Сохранить как...",
"SAVE": "Сохранить..."
}

View file

@ -108,5 +108,7 @@
"SUGGESTED_FIX_COMPILER_ERROR": "Solución sugerida: intente Ver> Panel> Krakatau> Bytecode y habilite Editable.",
"SEARCH_REGEX": "Buscar Regex: ",
"NEW_JAVASCRIPT_PLUGIN": "Nuevo complemento de Javascript",
"NEW_JAVA_PLUGIN": "Nuevo complemento de Java"
"NEW_JAVA_PLUGIN": "Nuevo complemento de Java",
"SAVE_AS": "Guardar como...",
"SAVE": "Ahorrar..."
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Pakia Rasilimali",
"SAVE_AS_DEX": "Hifadhi kama DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Programu-jalizi mpya ya Javascript",
"NEW_JAVA_PLUGIN": "Programu-jalizi mpya ya Java"
"NEW_JAVA_PLUGIN": "Programu-jalizi mpya ya Java",
"SAVE_AS": "Hifadhi kama ...",
"SAVE": "Hifadhi ...",
"RESULTS": "Matokeo"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Ladda om resurser",
"SAVE_AS_DEX": "Spara som DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Nytt Javascript-plugin",
"NEW_JAVA_PLUGIN": "Nytt Java-plugin"
"NEW_JAVA_PLUGIN": "Nytt Java-plugin",
"SAVE_AS": "Spara som...",
"SAVE": "Spara...",
"RESULTS": "Resultat"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Kaynakları Yeniden Yükle",
"SAVE_AS_DEX": "DEX Olarak Kaydet...",
"NEW_JAVASCRIPT_PLUGIN": "Yeni Javascript Eklentisi",
"NEW_JAVA_PLUGIN": "Yeni Java Eklentisi"
"NEW_JAVA_PLUGIN": "Yeni Java Eklentisi",
"SAVE_AS": "Farklı kaydet...",
"SAVE": "Kayıt etmek...",
"RESULTS": "Sonuçlar"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Перезавантажте ресурси",
"SAVE_AS_DEX": "Зберегти як DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Новий плагін Javascript",
"NEW_JAVA_PLUGIN": "Новий плагін Java"
"NEW_JAVA_PLUGIN": "Новий плагін Java",
"SAVE_AS": "Зберегти як...",
"SAVE": "Зберегти ...",
"RESULTS": "Результати"
}

View file

@ -107,5 +107,8 @@
"RELOAD_RESOURCES": "Tải lại tài nguyên",
"SAVE_AS_DEX": "Lưu dưới dạng DEX ...",
"NEW_JAVASCRIPT_PLUGIN": "Plugin Javascript mới",
"NEW_JAVA_PLUGIN": "Plugin Java mới"
"NEW_JAVA_PLUGIN": "Plugin Java mới",
"SAVE_AS": "Lưu thành...",
"SAVE": "Tiết kiệm...",
"RESULTS": "Các kết quả"
}