From 7d252fd5bcf44e94f6de167b1ec7064aa71dad47 Mon Sep 17 00:00:00 2001 From: Konloch Date: Tue, 27 Jul 2021 03:18:21 -0700 Subject: [PATCH] Translations Context menu translations --- .../resourcelist/contextmenu/impl/Collapse.java | 3 ++- .../gui/resourcelist/contextmenu/impl/Expand.java | 3 ++- .../gui/resourcelist/contextmenu/impl/Open.java | 3 ++- .../resourcelist/contextmenu/impl/QuickOpen.java | 14 +++++++------- .../gui/resourcelist/contextmenu/impl/Remove.java | 3 ++- .../translation/TranslatedStrings.java | 6 ++++++ src/main/resources/translations/english.json | 6 ++++++ 7 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Collapse.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Collapse.java index f4125355..6b62a99c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Collapse.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Collapse.java @@ -3,6 +3,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.impl; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuType; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import javax.swing.*; import java.awt.event.ActionEvent; @@ -35,7 +36,7 @@ public class Collapse extends ContextMenuItem { super(ContextMenuType.DIRECTORY, ((tree, selPath, menu) -> { - menu.add(new AbstractAction("Collapse") + menu.add(new AbstractAction(TranslatedStrings.COLLAPSE.toString()) { @Override public void actionPerformed(ActionEvent e) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Expand.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Expand.java index 7fdf8244..d346a701 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Expand.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Expand.java @@ -3,6 +3,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.impl; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuType; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import javax.swing.*; import java.awt.event.ActionEvent; @@ -35,7 +36,7 @@ public class Expand extends ContextMenuItem { super(ContextMenuType.DIRECTORY, ((tree, selPath, menu) -> { - menu.add(new AbstractAction("Expand") + menu.add(new AbstractAction(TranslatedStrings.EXPAND.toString()) { @Override public void actionPerformed(ActionEvent e) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Open.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Open.java index cd03c7d5..9ebe7180 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Open.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Open.java @@ -3,6 +3,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.impl; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuType; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import javax.swing.*; import java.awt.event.ActionEvent; @@ -35,7 +36,7 @@ public class Open extends ContextMenuItem { super(ContextMenuType.RESOURCE, ((tree, selPath, menu) -> { - menu.add(new AbstractAction("Open") + menu.add(new AbstractAction(TranslatedStrings.OPEN_UNSTYLED.toString()) { @Override public void actionPerformed(ActionEvent e) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/QuickOpen.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/QuickOpen.java index d9ae96a3..a161924a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/QuickOpen.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/QuickOpen.java @@ -4,9 +4,9 @@ import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuType; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import javax.swing.*; -import javax.swing.tree.TreePath; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -36,12 +36,12 @@ public class QuickOpen extends ContextMenuItem { super(ContextMenuType.RESOURCE, ((tree, selPath, menu) -> { - JMenu quickOpen = new JMenu("Quick Open"); - quickOpen.add(createMenu("Procyon", ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.PROCYON_DECOMPILER, selPath))); - quickOpen.add(createMenu("CFR", ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.CFR_DECOMPILER, selPath))); - quickOpen.add(createMenu("FernFlower", ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.FERNFLOWER_DECOMPILER, selPath))); - quickOpen.add(createMenu("Krakatau", ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.KRAKATAU_DECOMPILER, selPath))); - quickOpen.add(createMenu("Bytecode", ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.BYTECODE_DISASSEMBLER, selPath))); + JMenu quickOpen = new JMenu(TranslatedStrings.QUICK_OPEN.toString()); + quickOpen.add(createMenu(TranslatedStrings.PROCYON.toString(), ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.PROCYON_DECOMPILER, selPath))); + quickOpen.add(createMenu(TranslatedStrings.CFR.toString(), ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.CFR_DECOMPILER, selPath))); + quickOpen.add(createMenu(TranslatedStrings.FERNFLOWER.toString(), ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.FERNFLOWER_DECOMPILER, selPath))); + quickOpen.add(createMenu(TranslatedStrings.KRAKATAU.toString(), ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.KRAKATAU_DECOMPILER, selPath))); + quickOpen.add(createMenu(TranslatedStrings.BYTECODE.toString(), ()->BytecodeViewer.viewer.resourcePane.quickDecompile(Decompiler.BYTECODE_DISASSEMBLER, selPath))); menu.add(quickOpen); })); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Remove.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Remove.java index c79a62f6..0fc76c19 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Remove.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/contextmenu/impl/Remove.java @@ -3,6 +3,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.impl; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.resourcelist.contextmenu.ContextMenuType; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import javax.swing.*; import java.awt.event.ActionEvent; @@ -35,7 +36,7 @@ public class Remove extends ContextMenuItem { super(ContextMenuType.CONTAINER, ((tree, selPath, menu) -> { - menu.add(new AbstractAction("Remove") + menu.add(new AbstractAction(TranslatedStrings.REMOVE.toString()) { @Override public void actionPerformed(ActionEvent e) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java index 1d02fdf3..dc47421e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java @@ -60,6 +60,12 @@ public enum TranslatedStrings SEARCH, + OPEN_UNSTYLED, + QUICK_OPEN, + REMOVE, + NEW, + EXPAND, + COLLAPSE, RELOAD_RESOURCES_TITLE, RELOAD_RESOURCES_CONFIRM, SELECT_FILE_TITLE, diff --git a/src/main/resources/translations/english.json b/src/main/resources/translations/english.json index 38a8773c..2f4037d7 100644 --- a/src/main/resources/translations/english.json +++ b/src/main/resources/translations/english.json @@ -5,6 +5,12 @@ "RELOAD_RESOURCES": "Reload Resources", "RUN": "Run", "OPEN": "Open...", + "OPEN_UNSTYLED": "Open", + "QUICK_OPEN": "Quick Open", + "REMOVE": "Remove", + "NEW": "New", + "EXPAND": "Expand", + "COLLAPSE": "Collapse", "COMPILE": "Compile", "SAVE_AS_RUNNABLE_JAR": "Save As Runnable Jar...", "SAVE_AS_ZIP": "Save As Zip...",