Skip to content

l10n: add complete German localization - #225

Merged
LNPANDY merged 16 commits into
mainfrom
v0lumehi/l10n-german
Oct 30, 2026
Merged

LNPANDY merged 16 commits into
mainfrom
v0lumehi/l10n-german

Conversation

@v0lumehi

Copy link
Copy Markdown
Collaborator

What and why

German players had only the English interface. This adds a complete German localization to the Mac launcher and, through the generator, to the Qt front end. It follows the pattern of @yeager's Swedish PR #168: a de overlay below the (zh, en) table, a .de case in Lang, device-language selection for de*, a fifth entry in the Settings language picker (and in the controller cycle), and a fourth column generated into frontend-qt/nspb_qt/localization.py. The Qt language button now cycles zh, en, sv, de.

  • 845 strings translated (all 844 keys of main plus the new settings.language.de). No English fallback is left. 54 keys read the same in German on purpose (names, units, button letters) and are listed in the test.
  • Tone is informal "du", as in Apple's German macOS and iOS. Buttons are short verbs or nouns ("Abbrechen", "Fertig", "Erneut prüfen", "Installieren", "Ordner zeigen"). German quotes „…“ and a spaced ellipsis " …" as macOS writes it. No semicolons, no added product name.
  • Glossary: Spielstände (saves), Bibliothek (library), Build / Build-Werkzeuge (build, build tools), Schlüssel / Schlüsseldatei (keys), Signierteam, Zusatzinhalte (add-on content), Controller, Konsolenmodus, Desktop-Modus, Papierkorb, Programme, Mitteilung, Vollbild, Entwicklermodus, Schaltfläche (button), Titelbild (artwork), Protokoll (log). Kept as players see them elsewhere: prod.keys, NSP, XCI, NSZ, RomFS, romfs.img, DLC, IPA, Metal, Homebrew, devicectl, Xcode, .NET, Python, Title-ID, Build-ID, Shader, and every command in backticks. Xcode's menus are English-only, so they stay in quotes as Xcode shows them. iOS Settings paths use the German names.
  • Mac text says "klicke", the one iPhone step (Vertrauen) says "tippe".

Tests and tooling:

  • New GermanLocalizationTests: every key has German text, nothing is left in English except the listed names, format placeholders (%@, %d, %ld, positional, %%) match the English entry in count and order, no semicolons, no added product name, ellipsis and quote rules. Strings added by later PRs need their German entry, and this test fails for them, which is the point.
  • Qt: test_localization_de.py and the language tests extended.
  • NX_CAPTURE_LANG=de makes the existing capture tests render in one language.
  • Generator fix: it now unescapes \\, \t and \n from the Swift table for every column. Before, the Qt table showed a literal \t, \n and doubled backslashes (5 strings: install.step1-3, fail.noTitleID.next, dep.spirv.hint.win).
  • Tests that read English text now pin the language, because they failed on a Mac set to German.

Other open PRs add strings (#210, #213, #221, #222 removes app.subtitle). I translated what is on main. Whichever merges second needs its German entries.

Product change: per the merge rules this waits 48 hours.

Checked

  • Tests: cd frontend && swift build -c release && swift test passes (433 tests, 14 skipped). python3 -m unittest discover -s frontend-qt/tests passes except test_win.InstallFailureHintTest.test_network_disk_and_other_map_to_their_hints, which also fails on main (nspb_qt.model has no BuildModel). python3 scripts/patches.py check is ok.
  • Visual QA: NX_CAPTURE_LANG=de NX_LAUNCHER_CAPTURE_DIR=/tmp/de-shots NX_CONSOLE_CAPTURE_DIR=/tmp/de-shots/console NX_ONBOARDING_CAPTURE_DIR=/tmp/de-shots/onboarding swift test --filter "testRender|testCapture". I looked at the library, builds, settings, dependency and failure rows, saves, cheats, free space, controls, the console mode at TV, Mac and compact sizes, and onboarding. Fixes after the first pass: "Zurück zum Desktop" and "Im Desktop-Modus bleiben" clipped in the console bar and prompt (now "Zum Desktop" and "Nicht wechseln"), the player-mode note was cut in the middle (shortened), the iOS size note broke between "8" and "GB" (no-break spaces), and the footers of Controls and Free space were cut (shortened). No layout code changed. The long signing-team hint (dev.noTeam) is cut to one line as the English one is.
  • Run on a device: not applicable, text only. Not covered by screenshots: the Qt window (only the generated table and tests).

Screenshots

The CLI cannot upload them. They are in /tmp/de-shots/ on the author's Mac (console/, onboarding/), for example settings.png, build.png, library.png, row-noTitleID.png, console/full-mac-de.png, console/prompt-mac-de.png, onboarding/platform-de.png.

Not covered

  • The iOS shell UI in frontend-ios is still being built and has no German yet.
  • The engine's own iOS and Mac settings screens in dm/ are upstream and English only.

Scope

  • No vendored file is edited
  • Not an engine or game profile fix
  • No keys, game files or data extracted from a game

@v0lumehi

Copy link
Copy Markdown
Collaborator Author

Note for the rebase before this merges: #246 added new launcher strings (data.notSelectedDlc, data.updateNewest, data.rowNotBase, data.rowNotUpdate, data.rowNotDLC, data.rowOtherGame, data.dlcPanelMessage, data.dlcPanelPrompt, data.updatePanelMessage) and #242 changed how release notes pick a language. Both need German entries or a German fallback here.

@v0lumehi
v0lumehi force-pushed the v0lumehi/l10n-german branch from 3ddca9e to b7df5d4 Compare October 30, 2026 13:36
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

Rebased onto current main. Added German entries for the strings that landed since: the DLC and update row messages and panel texts from #246, the frame times strings from #112 and the return-after-play setting. The completeness test covers all keys, 865 strings now. ReleaseNotes.lines(_:for:) from #242 already gives German the English section, a test now pins that for the sectioned, the halves and the marker shapes. No semicolons in any string.

@v0lumehi

Copy link
Copy Markdown
Collaborator Author

@LNPANDY rebased onto current main, CI green. The German table now also covers the strings that landed meanwhile (#246, #112 and the return-after-play setting), and German reads the English section of bilingual release notes (#242). Like Swedish (#168), a new language may be better in a release of its own, your call. Mergeable after the 48 hours, from 2026-10-31 20:39 UTC.

The release app's Python lacked zbic, so a game with system 22.0.0+ modules
stopped with 'ZBIC (zstd) segments need the zbic package'. zbic is now pinned
in the bundle, checked by check_bundle.sh, part of the launcher's Python probe
and venv install, and a failed build with this message gets a failure row with
an install button (Swift and Qt, English, Chinese, Swedish).
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

Note for the next rebase, from the review of #256 (@LNPANDY's Qt locale fix):

The pins move to frontend/bundled-python/requirements.txt with every release file
hashed, bundle_tools.sh installs with --require-hashes, and dependabot.yml gets a
pip entry for that folder next to the github-actions one, both weekly and grouped.
@LNPANDY

LNPANDY commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Reviewed the German catalogue against current main (df713726). It is in good shape: 865/865 keys covered, no extra or duplicate keys, and every placeholder matches in order (%@ 146, %d 38, %ld 5, %% 4, positional %1$@/%2$@ and %.0f/%.1f included). The 55 entries identical to English are exactly the ones the test whitelists. I also re-ran gen_localization.py on a copy: the committed Qt table is byte-identical to the generator's output, so it was regenerated and not hand-edited.

One thing to fix before merge, and it is a bug this PR exposes rather than adds: the Qt/Windows language detection cannot see German. frontend-qt/nspb_qt/i18n.py asks GetLocaleInfoW for 0x00000002, commented as LOCALE_SISO639LANGNAME, but 0x02 is LOCALE_SLANGUAGE — the localized display name ("Deutsch (Deutschland)"). The de prefix test then fails on a German Windows. I fixed the constant (0x59) and the LANGID mask on main in #256 (db4c6924), together with a CI check that the Qt table matches Localization.swift.

So on rebase: keep main's i18n.py and localization.py (this branch's copy is now 18 keys behind and still has the old constant), then add DE to the Lang enum and to _by_prefix — that is the part only this PR has. The existing detect(...) tests will then cover German too; consider adding de-DE/Deutsch (Deutschland) and a Windows-mock case asserting 0x59.

Not blocking: i18n.py's initial() docstring still says "everything else is English", and the placeholder regex in both German tests does not match %.0f/%.1f (the data is correct today, but a future float placeholder would slip through).

Add a German overlay (L10n.de) for every string of the shared table, the
language in the device-language selection, the Settings picker and the Qt
language button, and generate it into the Qt table as a fourth column.
A new test fails for any key without German text or with different format
placeholders. The capture tests render in another language with NX_CAPTURE_LANG.
The generator now unescapes the Swift escapes (backslash, tab, newline) for all
columns, and tests that read English pin the language.
…ests

Lang.DE joins the Qt language cycle and Lang.initial() (saved choice, Windows ISO code, locale name). Adds the German text of cheats.iosNote (#257), regenerates the Qt table, and lets the German tests' placeholder pattern match %.0f and %.1f.
@v0lumehi
v0lumehi force-pushed the v0lumehi/l10n-german branch from b7df5d4 to c3ed86c Compare October 30, 2026 16:02
Bundle zbic and require it in the dependency probe
Hash-pin the bundled Python packages and let Dependabot update them
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

@LNPANDY rebased onto current main and force-pushed (c3ed86cf), CI green. Point by point:

  1. Rebase. Kept main's i18n.py (the 0x59 call with the 0x3FF mask) and main's structure, and regenerated localization.py with gen_localization.py from the rebased Localization.swift (866 strings), no copy of the branch's old file.
  2. German in Qt. Lang.DE is in the enum, in the language cycle (EN, Svenska, Deutsch, 中文) and in NSPB_LANG. initial() returns it for the Windows ISO code de and for a locale name. Main has no _by_prefix table, the prefixes are tested inline in initial(), so that is where de went. It matches de followed by nothing or a non-letter (so de_DE, de-AT, de_CH.UTF-8), plus german and deutsch in the name. A plain startswith('de') would have taken default as German.
  3. Tests. test_a_windows_display_name_still_selects_the_language now expects de and de-DE to give Lang.DE. New cases: Deutsch (Deutschland) through detect, and a Windows mock asserting GetLocaleInfoW is asked for 0x59 and a de answer gives German.
  4. Docstring. initial() no longer says "everything else is English" without the languages that have their own catalog.
  5. Placeholder regex. Both German tests (Python and GermanLocalizationTests.swift) now match %.0f and %.1f style placeholders. The Swift test's doc comment names them.
  6. Completeness after the rebase. It caught one key: cheats.iosNote from Cheats sheet: say that cheats are turned off on iPhone and iPad #257 had no German text. Added it, so all 866 keys are covered. swift build and swift test (478 tests) pass, as do the Qt tests, the regenerate-and-diff check and patches.py check.

v0lumehi and others added 7 commits October 30, 2026 17:39
Qt: regenerate the language table for the cheats iOS note
Manage > Saves no longer needs the launcher's install record or the signed
app it cached: the game is found on the device from `devicectl device info
apps` (the launcher's bundle ID, any bundle ID holding the title ID, then
the display name), so a game installed from the exported IPA with another
signing tool works. Both save layouts are read, Documents/save and
Documents/games/<title ID>/save, and a copy goes to the one in use.

With several devices the sheet shows a selector and names the device it
asks. A device that is not connected is not asked at all. Every devicectl
command has a deadline, a query that outlives its own gets a clear message,
Refresh is off while one runs, and an answer that arrives after its query
was given up or replaced is dropped.

Closes #250

Co-authored-by: Tiomehsh <[email protected]>
…ch folder is used

A Mac game in a library folder (.nx2apple-library beside the app) keeps its save in save/<title ID> there. The Saves window now uses the host's rule instead of the games/ folder, prefers that folder over the default location when both exist, and shows the folder under This Mac.

Co-authored-by: Tiomehsh <[email protected]>
On a real device the flag deletes the destination's siblings too, not only
its contents. A save push to Documents/games/<id>/save removed the game's
romfs.img, and a cheats push removed what sits beside Documents/games/<id>/cheats.

The copies now merge into the destination and delete nothing. A file the Mac
no longer has can stay in the device's folder, which is far safer than wiping
game data (devicectl has no command to delete a single file). The stand-in
devicectl in the tests now wipes the parent's entries when the flag is passed,
and the tests assert the flag is never passed and that game data stays.

Found and reproduced on real devices by Tiomehsh (#250).

Co-authored-by: Tiomehsh <[email protected]>
On a real device the flag deletes the destination's siblings too, not only
its contents. A save push to Documents/games/<id>/save removed the game's
romfs.img, and a cheats push removed what sits beside Documents/games/<id>/cheats.

The copies now merge into the destination and delete nothing. A file the Mac
no longer has can stay in the device's folder, which is far safer than wiping
game data (devicectl has no command to delete a single file). The stand-in
devicectl in the tests now wipes the parent's entries when the flag is passed,
and the tests assert the flag is never passed and that game data stays.

Found and reproduced on real devices by Tiomehsh (#250).

Co-authored-by: Tiomehsh <[email protected]>
v0lumehi and others added 3 commits October 30, 2026 18:59
Never pass devicectl's --remove-existing-content: it deleted game data on the device
…n added

Rebased onto current main and resolved the generated Qt table by regenerating it
(gen_localization.py), so this keeps main's fixes rather than reverting them:

- the ISO language code Windows is asked for (0x59), from #256 — without it a
  German Windows would still fall through to English on the Qt side
- the 18 keys #246 added to the Swift table without regenerating the Qt one

Ten strings had no German, because main added them after this branch was cut:
`saves.macLibrary`, `saves.macStandard`, `saves.macPending`, `saves.noDevices`,
`saves.notConnected`, `saves.timeout`, `saves.device`, `fail.zbic.what`,
`fail.zbic.next` and `fail.zbic.button`. Two existing entries no longer matched
the current English (`saves.reading`, `saves.notInstalled`): the first was missing
its `%@`, the second still described an older sentence.

Tests: swift test 500 tests, 0 failures; python -m unittest discover -s
frontend-qt/tests 188 tests OK.
@github-actions github-actions Bot added the ci Workflows and repository tooling label Oct 30, 2026
@LNPANDY
LNPANDY merged commit 898d794 into main Oct 30, 2026
11 checks passed
@Koshindai Koshindai mentioned this pull request Oct 30, 2026
4 of 5 tasks
@v0lumehi
v0lumehi deleted the v0lumehi/l10n-german branch November 1, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Workflows and repository tooling documentation Improvements or additions to documentation enhancement New feature or request launcher The NX2Apple launcher app windows Windows (the Qt front end)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants