From a3bbf8198b3f543ecd79c40ff00be2b988d295ee Mon Sep 17 00:00:00 2001 From: Isaaku Date: Wed, 14 Aug 2019 17:16:21 -0500 Subject: [PATCH] Added missing history properties to LabelsBundle --- .../ripme/ui/HistoryMenuMouseListener.java | 10 +++--- .../com/rarchives/ripme/ui/MainWindow.java | 32 ++++++++----------- src/main/resources/LabelsBundle.properties | 27 ++++++++++++---- workspace.code-workspace | 16 ++++++++++ 4 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 workspace.code-workspace diff --git a/src/main/java/com/rarchives/ripme/ui/HistoryMenuMouseListener.java b/src/main/java/com/rarchives/ripme/ui/HistoryMenuMouseListener.java index 61037626..9044531f 100644 --- a/src/main/java/com/rarchives/ripme/ui/HistoryMenuMouseListener.java +++ b/src/main/java/com/rarchives/ripme/ui/HistoryMenuMouseListener.java @@ -10,13 +10,15 @@ import javax.swing.Action; import javax.swing.JPopupMenu; import javax.swing.JTable; +import com.rarchives.ripme.utils.Utils; + class HistoryMenuMouseListener extends MouseAdapter { private JPopupMenu popup = new JPopupMenu(); private JTable tableComponent; @SuppressWarnings("serial") public HistoryMenuMouseListener() { - Action checkAllAction = new AbstractAction("Check All") { + Action checkAllAction = new AbstractAction(Utils.getLocalizedString("history.check.all")) { @Override public void actionPerformed(ActionEvent ae) { for (int row = 0; row < tableComponent.getRowCount(); row++) { @@ -26,7 +28,7 @@ class HistoryMenuMouseListener extends MouseAdapter { }; popup.add(checkAllAction); - Action uncheckAllAction = new AbstractAction("Check None") { + Action uncheckAllAction = new AbstractAction(Utils.getLocalizedString("history.check.none")) { @Override public void actionPerformed(ActionEvent ae) { for (int row = 0; row < tableComponent.getRowCount(); row++) { @@ -38,7 +40,7 @@ class HistoryMenuMouseListener extends MouseAdapter { popup.addSeparator(); - Action checkSelected = new AbstractAction("Check Selected") { + Action checkSelected = new AbstractAction(Utils.getLocalizedString("history.check.selected")) { @Override public void actionPerformed(ActionEvent ae) { for (int row : tableComponent.getSelectedRows()) { @@ -48,7 +50,7 @@ class HistoryMenuMouseListener extends MouseAdapter { }; popup.add(checkSelected); - Action uncheckSelected = new AbstractAction("Uncheck Selected") { + Action uncheckSelected = new AbstractAction(Utils.getLocalizedString("history.uncheck.selected")) { @Override public void actionPerformed(ActionEvent ae) { for (int row : tableComponent.getSelectedRows()) { diff --git a/src/main/java/com/rarchives/ripme/ui/MainWindow.java b/src/main/java/com/rarchives/ripme/ui/MainWindow.java index 2d69542c..bbc656be 100644 --- a/src/main/java/com/rarchives/ripme/ui/MainWindow.java +++ b/src/main/java/com/rarchives/ripme/ui/MainWindow.java @@ -849,8 +849,8 @@ public final class MainWindow implements Runnable, RipStatusHandler { // Re-rip all history historyButtonRerip.addActionListener(event -> { if (HISTORY.isEmpty()) { - JOptionPane.showMessageDialog(null, "There are no history entries to re-rip. Rip some albums first", - "RipMe Error", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, Utils.getLocalizedString("history.load.none"), "RipMe Error", + JOptionPane.ERROR_MESSAGE); return; } int added = 0; @@ -861,8 +861,7 @@ public final class MainWindow implements Runnable, RipStatusHandler { } } if (added == 0) { - JOptionPane.showMessageDialog(null, "No history entries have been 'Checked'\n" - + "Check an entry by clicking the checkbox to the right of the URL or Right-click a URL to check/uncheck all items", + JOptionPane.showMessageDialog(null, Utils.getLocalizedString("history.load.none.checked"), "RipMe Error", JOptionPane.ERROR_MESSAGE); } }); @@ -1009,26 +1008,26 @@ public final class MainWindow implements Runnable, RipStatusHandler { mainFrame.addWindowListener(new WindowAdapter() { @Override public void windowActivated(WindowEvent e) { - trayMenuMain.setLabel("Hide"); + trayMenuMain.setLabel(Utils.getLocalizedString("tray.hide")); } @Override public void windowDeactivated(WindowEvent e) { - trayMenuMain.setLabel("Show"); + trayMenuMain.setLabel(Utils.getLocalizedString("tray.show")); } @Override public void windowDeiconified(WindowEvent e) { - trayMenuMain.setLabel("Hide"); + trayMenuMain.setLabel(Utils.getLocalizedString("tray.hide")); } @Override public void windowIconified(WindowEvent e) { - trayMenuMain.setLabel("Show"); + trayMenuMain.setLabel(Utils.getLocalizedString("tray.show")); } }); PopupMenu trayMenu = new PopupMenu(); - trayMenuMain = new MenuItem("Hide"); + trayMenuMain = new MenuItem(Utils.getLocalizedString("tray.hide")); trayMenuMain.addActionListener(arg0 -> toggleTrayClick()); MenuItem trayMenuAbout = new MenuItem("About " + mainFrame.getTitle()); trayMenuAbout.addActionListener(arg0 -> { @@ -1079,9 +1078,9 @@ public final class MainWindow implements Runnable, RipStatusHandler { } } }); - MenuItem trayMenuExit = new MenuItem("Exit"); + MenuItem trayMenuExit = new MenuItem(Utils.getLocalizedString("tray.exit")); trayMenuExit.addActionListener(arg0 -> System.exit(0)); - trayMenuAutorip = new CheckboxMenuItem("Clipboard Autorip"); + trayMenuAutorip = new CheckboxMenuItem(Utils.getLocalizedString("tray.autorip")); trayMenuAutorip.addItemListener(arg0 -> { ClipboardUtils.setClipboardAutoRip(trayMenuAutorip.getState()); configClipboardAutorip.setSelected(trayMenuAutorip.getState()); @@ -1122,10 +1121,10 @@ public final class MainWindow implements Runnable, RipStatusHandler { mainFrame.setVisible(true); mainFrame.setAlwaysOnTop(true); mainFrame.setAlwaysOnTop(false); - trayMenuMain.setLabel("Hide"); + trayMenuMain.setLabel(Utils.getLocalizedString("tray.hide")); } else { mainFrame.setVisible(false); - trayMenuMain.setLabel("Show"); + trayMenuMain.setLabel(Utils.getLocalizedString("tray.show")); } } @@ -1170,10 +1169,7 @@ public final class MainWindow implements Runnable, RipStatusHandler { } catch (IOException e) { LOGGER.error("Failed to load history from file " + historyFile, e); JOptionPane.showMessageDialog(null, - "RipMe failed to load the history file at " + historyFile.getAbsolutePath() + "\n\n" + "Error: " - + e.getMessage() + "\n\n" - + "Closing RipMe will automatically overwrite the contents of this file,\n" - + "so you may want to back the file up before closing RipMe!", + String.format(Utils.getLocalizedString("history.load.failed.warning"), e.getMessage()), "RipMe - history load failure", JOptionPane.ERROR_MESSAGE); } } else { @@ -1446,7 +1442,7 @@ public final class MainWindow implements Runnable, RipStatusHandler { openButton.setVisible(true); File f = rsc.dir; String prettyFile = Utils.shortenPath(f); - openButton.setText("Open " + prettyFile); + openButton.setText(Utils.getLocalizedString("open") + prettyFile); mainFrame.setTitle("RipMe v" + UpdateUtils.getThisJarVersion()); try { Image folderIcon = ImageIO.read(getClass().getClassLoader().getResource("folder.png")); diff --git a/src/main/resources/LabelsBundle.properties b/src/main/resources/LabelsBundle.properties index 215e0f55..575f4f8e 100644 --- a/src/main/resources/LabelsBundle.properties +++ b/src/main/resources/LabelsBundle.properties @@ -4,9 +4,9 @@ created = created modified = modified queue = Queue Configuration = Configuration +open = Open # Keys for the Configuration menu - current.version = Current version check.for.updates = Check for updates auto.update = Auto-update? @@ -32,19 +32,32 @@ queue.remove.all = Remove All queue.validation = Are you sure you want to remove all elements from the queue? queue.remove.selected = Remove Selected -# Misc UI keys - -loading.history.from.configuration = Loading history from configuration -interrupted.while.waiting.to.rip.next.album = Interrupted while waiting to rip next album -inactive = Inactive +# History re-rip.checked = Re-rip Checked remove = Remove clear = Clear +history.check.all = Check All +history.check.none = Check None +history.check.selected = Check Selected +history.uncheck.selected = Uncheck Selected +history.load.failed.warning = RipMe failed to load the history file at historyFile.getAbsolutePath() \n\nError: %s\n\nClosing RipMe will automatically overwrite the contents of this file,\nso you may want to back the file up before closing RipMe! +history.load.none = There are no history entries to re-rip. Rip some albums first +history.load.none.checked = No history entries have been 'Checked' Check an entry by clicking the checkbox to the right of the URL or Right-click a URL to check/uncheck all items + +# TrayIcon +tray.show = Show +tray.hide = Hide +tray.autorip = Clipboard Autorip +tray.exit = Exit + +# Misc UI keys +loading.history.from.configuration = Loading history from configuration +interrupted.while.waiting.to.rip.next.album = Interrupted while waiting to rip next album +inactive = Inactive download.url.list = Download url list select.save.dir = Select Save Directory # Keys for the logs generated by DownloadFileThread - nonretriable.status.code = Non-retriable status code retriable.status.code = Retriable status code server.doesnt.support.resuming.downloads = Server doesn't support resuming downloads diff --git a/workspace.code-workspace b/workspace.code-workspace new file mode 100644 index 00000000..95b80106 --- /dev/null +++ b/workspace.code-workspace @@ -0,0 +1,16 @@ +{ + "folders": [ + { + "path": "E:\\Downloads\\_Isaaku\\dev" + } + ], + "settings": { + "files.exclude": { + "**/.classpath": false, + "**/.project": true, + "**/.settings": true, + "**/.factorypath": true + }, + "java.configuration.updateBuildConfiguration": "automatic" + } +} \ No newline at end of file