From 4f39292e8f081524dfa487f7eb2579af8d3f15ad Mon Sep 17 00:00:00 2001 From: NebelNidas Date: Sun, 25 Aug 2024 01:19:46 +0200 Subject: [PATCH] Make `legacy` suffix translatable --- .../src/main/java/cuchaz/enigma/gui/elements/MenuBar.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java index a0d1d3c2..d7054f78 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java @@ -415,9 +415,11 @@ private static void prepareOpenMappingsMenu(JMenu openMappingsMenu, Gui gui) { openMappingsMenu.addSeparator(); // Enigma's own readers + String legacySuffix = " (" + I18n.translate("legacy") + ")"; + for (MappingFormat format : MappingFormat.values()) { if (format.getReader() != null) { - addOpenMappingsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)) + " (legacy)", + addOpenMappingsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)) + legacySuffix, format, false, openMappingsMenu, gui); } } @@ -450,9 +452,11 @@ private static void prepareSaveMappingsAsMenu(JMenu saveMappingsAsMenu, JMenuIte saveMappingsAsMenu.addSeparator(); // Enigma's own writers + String legacySuffix = " (" + I18n.translate("legacy") + ")"; + for (MappingFormat format : MappingFormat.values()) { if (format.getWriter() != null) { - addSaveMappingsAsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)) + " (legacy)", + addSaveMappingsAsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)) + legacySuffix, format, false, saveMappingsAsMenu, saveMappingsItem, gui); } }