More Translations

This commit is contained in:
Konloch 2021-07-21 09:06:00 -07:00
parent 87ff4bd291
commit 0898588be6
5 changed files with 51 additions and 19 deletions

View File

@ -2,6 +2,7 @@ package the.bytecode.club.bytecodeviewer.api;
import the.bytecode.club.bytecodeviewer.gui.components.SystemConsole;
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
/***************************************************************************
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
@ -29,11 +30,12 @@ import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
public class PluginConsole extends SystemConsole
{
//window showing is disabled to allow this frame to be added as a tab
private boolean showWindow;
public PluginConsole(String pluginName)
{
super("Bytecode Viewer - Plugin Console - " + pluginName);
super(TranslatedStrings.PLUGIN_CONSOLE_TITLE + " - " + pluginName);
PluginManager.addConsole(this);
}

View File

@ -809,7 +809,8 @@ public class MainViewerGUI extends JFrame
});
}
public synchronized void updateBusyStatus(final boolean busy) {
public synchronized void updateBusyStatus(final boolean busy)
{
SwingUtilities.invokeLater(() ->
{
if (busy)
@ -853,8 +854,8 @@ public class MainViewerGUI extends JFrame
public void reloadResources()
{
MultipleChoiceDialog dialog = new MultipleChoiceDialog("Bytecode Viewer - Reload Resources",
"Are you sure you wish to reload the resources?",
MultipleChoiceDialog dialog = new MultipleChoiceDialog(TranslatedStrings.RELOAD_RESOURCES_TITLE.toString(),
TranslatedStrings.RELOAD_RESOURCES_CONFIRM.toString(),
new String[]{TranslatedStrings.YES.toString(), TranslatedStrings.NO.toString()});
if (dialog.promptChoice() == 0)
@ -862,7 +863,8 @@ public class MainViewerGUI extends JFrame
LazyNameUtil.reset();
ArrayList<File> reopen = new ArrayList<>();
for (ResourceContainer container : BytecodeViewer.resourceContainers) {
for (ResourceContainer container : BytecodeViewer.resourceContainers)
{
File newFile = new File(container.file.getParent() + fs + container.name);
if (!container.file.getAbsolutePath().equals(newFile.getAbsolutePath()) &&
(container.file.getAbsolutePath().endsWith(".apk") || container.file.getAbsolutePath().endsWith(".dex"))) //APKs & dex get renamed
@ -875,7 +877,8 @@ public class MainViewerGUI extends JFrame
BytecodeViewer.resourceContainers.clear();
for (File f : reopen) {
for (File f : reopen)
{
BytecodeViewer.openFiles(new File[]{f}, false);
}
@ -885,8 +888,8 @@ public class MainViewerGUI extends JFrame
public void selectFile()
{
final File file = DialogUtils.fileChooser("Select File or Folder to open in BCV",
"APKs, DEX, Class Files or Zip/Jar/War Archives",
final File file = DialogUtils.fileChooser(TranslatedStrings.SELECT_FILE_TITLE.toString(),
TranslatedStrings.SELECT_FILE_DESCRIPTION.toString(),
Constants.SUPPORTED_FILE_EXTENSIONS);
if(file == null)
@ -899,8 +902,8 @@ public class MainViewerGUI extends JFrame
public void openExternalPlugin()
{
final File file = DialogUtils.fileChooser("Select External Plugin",
"External Plugin",
final File file = DialogUtils.fileChooser(TranslatedStrings.SELECT_EXTERNAL_PLUGIN_TITLE.toString(),
TranslatedStrings.SELECT_EXTERNAL_PLUGIN_DESCRIPTION.toString(),
Configuration.getLastPluginDirectory(),
PluginManager.fileFilter(),
Configuration::setLastPluginDirectory,
@ -917,8 +920,8 @@ public class MainViewerGUI extends JFrame
public void askBeforeExiting()
{
MultipleChoiceDialog dialog = new MultipleChoiceDialog("Bytecode Viewer - Exit",
"Are you sure you want to exit?",
MultipleChoiceDialog dialog = new MultipleChoiceDialog(TranslatedStrings.EXIT_TITLE.toString(),
TranslatedStrings.EXIT_CONFIRM.toString(),
new String[]{TranslatedStrings.YES.toString(), TranslatedStrings.NO.toString()});
if (dialog.promptChoice() == 0)
@ -931,10 +934,7 @@ public class MainViewerGUI extends JFrame
public void showForeignLibraryWarning()
{
if (!deleteForeignOutdatedLibs.isSelected())
{
BytecodeViewer.showMessage("WARNING: With this being toggled off outdated libraries will NOT be "
+ "removed. It's also a security issue. ONLY TURN IT OFF IF YOU KNOW WHAT YOU'RE DOING.");
}
BytecodeViewer.showMessage(TranslatedStrings.FOREIGN_LIBRARY_WARNING.toString());
Configuration.deleteForeignLibraries = deleteForeignOutdatedLibs.isSelected();
}
@ -957,6 +957,7 @@ public class MainViewerGUI extends JFrame
Configuration.rstaTheme.apply(viewerClass.bytecodeViewPanel2.textArea);
Configuration.rstaTheme.apply(viewerClass.bytecodeViewPanel3.textArea);
}
SwingUtilities.updateComponentTreeUI(BytecodeViewer.viewer);
}
catch (Exception ex)

View File

@ -7,6 +7,7 @@ import javax.swing.JScrollPane;
import the.bytecode.club.bytecodeviewer.bootloader.InitialBootScreen;
import the.bytecode.club.bytecodeviewer.resources.IconResources;
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
import static the.bytecode.club.bytecodeviewer.Configuration.*;
@ -29,7 +30,7 @@ import static the.bytecode.club.bytecodeviewer.Configuration.*;
***************************************************************************/
/**
* The about frame
* The about window - used to explain what BCV is, how to use it, etc.
*
* @author Konloch
*/
@ -40,7 +41,7 @@ public class AboutWindow extends JFrame
{
this.setIconImages(IconResources.iconList);
setSize(InitialBootScreen.getSafeSize());
setTitle("Bytecode Viewer - About - https://bytecodeviewer.com | https://the.bytecode.club");
setTitle(TranslatedStrings.ABOUT_TITLE.toString());
getContentPane().setLayout(new CardLayout(0, 0));
JScrollPane scrollPane = new JScrollPane();

View File

@ -59,6 +59,20 @@ public enum TranslatedStrings
RESULTS,
SEARCH,
RELOAD_RESOURCES_TITLE,
RELOAD_RESOURCES_CONFIRM,
SELECT_FILE_TITLE,
SELECT_FILE_DESCRIPTION,
SELECT_EXTERNAL_PLUGIN_TITLE,
SELECT_EXTERNAL_PLUGIN_DESCRIPTION,
FOREIGN_LIBRARY_WARNING,
EXIT_TITLE,
EXIT_CONFIRM,
ABOUT_TITLE,
PLUGIN_CONSOLE_TITLE,
YES,
NO,
ERROR2,
@ -137,7 +151,7 @@ public enum TranslatedStrings
.replace("{PRODUCT_NAME}", PRODUCT_NAME.toString())
.replace("{PRODUCT-NAME}", PRODUCT_H_NAME.toString())
.replace("{PRODUCT}", PRODUCT.toString())
.replace("{TBV}", TBC.toString())
.replace("{TBC}", TBC.toString())
.replace("{WEBSITE}", WEBSITE.toString())
;

View File

@ -238,6 +238,20 @@
"RETAIN_REDUNDANT_CASTS": "Retain Redundant Casts",
"UNICODE_OUTPUT_ENABLED": "Unicode Output Enabled",
"RELOAD_RESOURCES_TITLE": "{PRODUCT_NAME} - Reload Resources",
"RELOAD_RESOURCES_CONFIRM": "Are you sure you wish to reload the resources?",
"SELECT_FILE_TITLE": "Select File or Folder to open in {BCV}",
"SELECT_FILE_DESCRIPTION": "APKs, DEX, Class Files or Zip/Jar/War Archives",
"SELECT_EXTERNAL_PLUGIN_TITLE": "Select External Plugin",
"SELECT_EXTERNAL_PLUGIN_DESCRIPTION": "BCV External Plugin in js, java, python, ruby or groovy",
"FOREIGN_LIBRARY_WARNING": "WARNING: With this being toggled off outdated libraries will NOT be removed.\nIt's also a security issue.\nONLY TURN IT OFF IF YOU KNOW WHAT YOU'RE DOING.",
"EXIT_TITLE": "{PRODUCT_NAME} - Exit",
"EXIT_CONFIRM": "Are you sure you want to exit?",
"ABOUT_TITLE": "{PRODUCT_NAME} - About - {WEBSITE} | {TBC}",
"PLUGIN_CONSOLE_TITLE": "{PRODUCT_NAME} - Plugin Console",
"FILES": "Files",
"QUICK_FILE_SEARCH_NO_FILE_EXTENSION": "Quick file search (no file extension)",
"WORK_SPACE": "Work Space",