From ea23ed911ccf2247f72e18fa675496f641a78f8f Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Tue, 27 Dec 2022 19:57:27 +0100 Subject: [PATCH] Bugfix packetlogger internationalization --- .../uilogger/UiLoggerController.java | 11 +++++++---- .../gearth/ui/translations/messages_nl.properties | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/G-Earth/src/main/java/gearth/services/internal_extensions/uilogger/UiLoggerController.java b/G-Earth/src/main/java/gearth/services/internal_extensions/uilogger/UiLoggerController.java index cbda232..bb1f5d7 100644 --- a/G-Earth/src/main/java/gearth/services/internal_extensions/uilogger/UiLoggerController.java +++ b/G-Earth/src/main/java/gearth/services/internal_extensions/uilogger/UiLoggerController.java @@ -275,12 +275,15 @@ public class UiLoggerController implements Initializable { Hexdump.hexdump(packet.toBytes()) : (chkReprRawHex.isSelected() ? Bytes.wrap(packet.toBytes()).encodeHex() : packet.toString()); - String type = isIncoming ? LanguageBundle.get("ext.logger.element.direction.incoming") : LanguageBundle.get("ext.logger.element.direction.outgoing"); + String packetType = isIncoming ? "incoming" : "outgoing"; + String type = isIncoming ? + LanguageBundle.get("ext.logger.element.direction.incoming") : + LanguageBundle.get("ext.logger.element.direction.outgoing"); if (!chkReprHex.isSelected()) { - elements.add(new Element(String.format("%s[", type), type.toLowerCase())); + elements.add(new Element(String.format("%s[", type), packetType)); elements.add(new Element(String.valueOf(packet.headerId()), "")); - elements.add(new Element("]", type.toLowerCase())); + elements.add(new Element("]", packetType)); elements.add(new Element(" -> ", "")); } @@ -288,7 +291,7 @@ public class UiLoggerController implements Initializable { if (isSkipped) { elements.add(new Element(String.format("<%s>", LanguageBundle.get("ext.logger.element.skipped")), "skipped")); } else - elements.add(new Element(packetRepresentation, String.format(chkReprHex.isSelected() ? "%sHex": "%s", type.toLowerCase()))); + elements.add(new Element(packetRepresentation, String.format(chkReprHex.isSelected() ? "%sHex": "%s", packetType))); elements.add(new Element("\n", "")); } diff --git a/G-Earth/src/main/resources/gearth/ui/translations/messages_nl.properties b/G-Earth/src/main/resources/gearth/ui/translations/messages_nl.properties index a8ea4a4..cb68d0f 100644 --- a/G-Earth/src/main/resources/gearth/ui/translations/messages_nl.properties +++ b/G-Earth/src/main/resources/gearth/ui/translations/messages_nl.properties @@ -282,7 +282,7 @@ ext.logger.menu.window.ondisconnect.hidewindow=Verberg venster ext.logger.menu.window.ondisconnect.reset=Reset packetlogger ext.logger.menu.view=Weergave -ext.logger.menu.view.incoming=Geef binnenkomend weer +ext.logger.menu.view.incoming=Geef inkomend weer ext.logger.menu.view.outgoing=Geef uitgaand weer ext.logger.menu.view.autoscroll=Autoscroll ext.logger.menu.view.cleartext=Wis tekst @@ -317,8 +317,8 @@ ext.logger.state.filtered=Gefilterd ext.logger.element.timestamp=tijdstempel ext.logger.element.blocked=Geblokkeerd ext.logger.element.replaced=Vervangen -ext.logger.element.direction.outgoing=Binnenkomend -ext.logger.element.direction.incoming=Uitgaand +ext.logger.element.direction.outgoing=Uitgaand +ext.logger.element.direction.incoming=Inkomend ext.logger.element.skipped=packet overgeslagen ext.logger.state.true=True ext.logger.state.false=False \ No newline at end of file