Skip to content

Mac settings window: build-time translation (DM_SETTINGS_LANG), with Italian - #2893

Open
ale-ehp wants to merge 1 commit into
seedds:mainfrom
ale-ehp:settings-window-italian
Open

ale-ehp wants to merge 1 commit into
seedds:mainfrom
ale-ehp:settings-window-italian

Conversation

@ale-ehp

@ale-ehp ale-ehp commented Nov 16, 2026 •

Copy link
Copy Markdown

What and why

A Mac app's settings window is English only. This adds a build-time translation: with DM_SETTINGS_LANG=it set for the NSP script, dm/games/settings.py reads dm/games/settings.it.tsv and writes into dm/launcher.json:

  • the translated labels, notes, options and sections;
  • a ui table for the window's own strings, including the cloud-save questions before the game, with the window on or off.

Launcher.swift and LauncherRow.swift look the strings up through L(), which falls back to English. A build without the variable gives the same launcher.json as before, and a string the table lacks stays English. The table format is one key and its text per line (<VAR>.label, <VAR>.note, <VAR>=<value>, section:<Name>, ui:<English>), so another language only needs its own settings.<lang>.tsv.

#780 localizes the built-in launchers inside the app with stable keys. This is a smaller build-time form that needs no app changes per language. If #780 is preferred, the Italian strings here can move into it.

Not translated: SaveSyncReport's own texts (the cloud-save choice's title and message), which the iPhone app shares.

Checked

  • Tests: dm.tools.tests.test_settings and test_launcher_settings pass. test_env_switches / test_docs show the same failures as main without this change (switches quoted but read nowhere, DM_GL_RENDERPROGS / DM_NVN_UNBIND_DEFER without a row). dm/tools/lint_python.py --against main: 0 new.
  • CI on this PR: Tool tests fails only on test_env_switches, with the same list as on 60284e79 without this change. Host unit tests aborted in t_pad_hid_mac (the HIDPAD_NIN_TRIES assertion, t_pad_hid_mac.m:236), which this change does not reach; it passes 6 of 6 runs here, and main's host job has failed on other tests too (t_dirty_reuse on b04c42b).
  • On main: the Mac launcher's Swift typechecks with the four sources pack_app.py compiles (swiftc -typecheck, macOS 26 target). settings.build() for Ocarina of Time (0400486024DEC000 v131072):
    • with the variable, Italian labels and the ui table for both SETTINGS_PLATFORM=mac and ios;
    • without it, English labels and no ui table.
  • A full app with this change was built and played on swordboiMacNative's branch: Ocarina of Time's Mac app on a Mac mini M4 Pro, macOS 27.2.1. The window shows Italian labels, notes, options, sections and buttons ("Play" → "Gioca", "Quit %@" → "Esci da %@"). It was not built as a full app from main.

Front ends

Front-ends: new: dm/launcher.json may carry a "ui" table (English string → translation) when the app is built with DM_SETTINGS_LANG; its settings' labels, notes and options are then translated. A front end may ignore it.

Docs

  • docs/settings.md says how to use it; docs/env_switches.tsv lists DM_SETTINGS_LANG
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

…SETTINGS_LANG=it

The settings window of a Mac app is in English only. With DM_SETTINGS_LANG=<lang> set for the NSP
script, settings.py reads dm/games/settings.<lang>.tsv (one key and its text per line: <VAR>.label,
<VAR>.note, <VAR>=<value> for a choice's option, section:<Name>, ui:<the window's own English string>)
and writes the translated labels, notes, options and sections into launcher.json, plus a ui table for
the window's own strings. Launcher.swift (the window, its menu, and the cloud-save questions before the
game, with the window on or off) and LauncherRow.swift look those up through L(), which falls back to
the English string, so a build without the variable, or a string the table lacks, stays as it was.
settings.it.tsv is the Italian table. The cloud-save choice's own texts (SaveSyncReport) stay English.

Checked: on swordboiMacNative's branch, the Ocarina of Time v131072 Mac app built with
DM_SETTINGS_LANG=it shows its labels, notes, options, sections and buttons in Italian. On main: the Mac
launcher's Swift typechecks with the four sources pack_app.py compiles; settings.build() for Ocarina of
Time gives Italian labels and the ui table for mac and ios with the variable, and no ui table and the
English labels without it; test_settings and test_launcher_settings pass. Upstream PR seedds#780 localizes the
built-in launchers with stable keys inside the app; this is the smaller build-time form.

Front-ends: new: dm/launcher.json may carry a "ui" table (English string → translation) when the app is built with DM_SETTINGS_LANG; its settings' labels, notes and options are then translated. A front end may ignore it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m) docs Documentation labels Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant