Common: make console dump headings translatable#124
Open
JumpLink wants to merge 1 commit into
Open
Conversation
The game console event bridge concatenated the hard-coded strings "Hexdump:\n" and "Disassembly:\n" with the dump content, so the heading could never be translated: the GNOME app looks the whole message up via gettext, which fails for strings with dynamic parts. Dispatch the static msgids "Hexdump:\n%s" / "Disassembly:\n%s" with the dump content as printf param instead, so every platform's formatAndLog can translate the heading and substitute the content. Add common-ui to the xgettext sources and seed the new msgstrs from the existing "Hexdump" / "Disassembled" heading translations. Fixes #122
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #122
Stacked on #123 (the Android path needs the printf-param substitution introduced there). Merge #123 first, then change this PR's base back to
main.Problem
game-console-event-bridge.tsconcatenated the hard-coded strings"Hexdump:\n"/"Disassembly:\n"with the dump content. The heading could never be translated: the GNOME app translates console messages by looking up the whole message via gettext, and a string with dynamic content never matches a msgid. So the English "Hexdump:" heading appeared in the GNOME message console regardless of locale.Fix
The bridge now dispatches the static msgids
"Hexdump:\n%s"/"Disassembly:\n%s"with the dump content as printf parameter:formatAndLog— GNOME viaString.format, Android vialocalize()/vsprintf.common-uiwas added to the xgettext source globs so its strings get extracted; the pseudo-_()marker from@learn6502/6502keeps the package platform-independent."Hexdump"/"Disassembled"section-heading translations in all 15 languages (translators can refine via Weblate). All.pofiles validated withmsgfmt --check.Note: the disassembly event currently never carries a
message(onlydata), so that branch is inactive at runtime — it was fixed consistently anyway.Verification
"Hexdump:\n%s".format("0600: a9 01 …")renders heading + content correctly.%s-containing translations (e.g. he:"Hexdump:\n%s": "חילוץ הקסדצימלי:\n%s").yarn format,yarn check:format,yarn buildpass;common-uitype check passes.