Repository navigation
Conversation
Amost-
force-pushed
the
pr/mac-language-default
branch
4 times, most recently
from
October 27, 2026 21:01
d5e8f49 to
2ee1cdd
Compare
5 of 12 tasks
Amost-
force-pushed
the
pr/mac-language-default
branch
5 times, most recently
from
October 31, 2026 08:16
99207b7 to
b2a575d
Compare
With DM_LANG unset, the Mac host answers GetDesiredLanguage / GetRegionCode with the first of the Mac's preferred languages the game supports (control.nacp SupportedLanguageFlag), resolved once at startup before guest threads run, and logs the choice; when none is supported, en-US if the game has it, else the game's first language. An explicit DM_LANG still wins; iOS is unchanged. The language table moves to lang.c, shared through hle.h. The Mac app writes DMLanguage, and the Mac run command sets DM_LANG, only when --language / LANGUAGE names one, so by default both follow the Mac; the app carries the game's control.nacp (the base game's when the packed version has none). Tests: t_lang, test_nsp_mac_app. Documented in docs/reference/services.md and docs/development.md. Behaviour change: Mac apps and run commands without --language no longer default to en-US. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Amost-
force-pushed
the
pr/mac-language-default
branch
from
November 3, 2026 12:43
b2a575d to
4a5b357
Compare
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.
On the Mac every game started in English: nothing sets
DM_LANGthere, andhle_oe.canswereden-US. With this PR the Mac host follows the Mac's own language.DM_LANGunset,GetDesiredLanguage/GetRegionCodeanswer the first of the Mac's preferred languages ([NSLocale preferredLanguages], inlang_mac.m, Mac only) that the game supports, read fromcontrol.nacp(SupportedLanguageFlag) beside the version's RomFS. Region variants map as the NSP script maps them (it-IT→it,en-AU→en-GB,es-MX→es-419, …). When none of the Mac's languages is the game's:en-USif the game has it, else the game's first language. The choice is made once at startup, before any guest thread runs (setenvmust not race the guest'sgetenv), and logged:language: it (macOS preferred it-IT, en-GB; game supports en-US en-GB ja fr de es it). An explicitDM_LANGstill wins; iOS is unchanged (its app always setsDM_LANG). The language code table moves fromhle_sdk16.ctolang.c, shared throughhle.h.--platform mac-app).pack_app.pywritesDMLanguageonly when--language/LANGUAGEnames one, so by default the app follows the Mac; it also packs the game'scontrol.nacpbesideromfs/(the base game's when the packed version has none). The Mac run command setsDM_LANGlikewise only for a language asked for.docs/reference/services.md, "Game language default from the Mac's preferred languages";docs/development.mdupdated.Behaviour change: Mac apps and Mac run commands built without
--languageno longer default toen-US; they follow the Mac. A game that stores its language in its save (FINAL FANTASY CRYSTAL CHRONICLES Remastered Edition does) keeps the save's language; the default applies to new saves.Checked
main(9a56ecf): the host unit tests (newt_lang: 106 checks of the mapping, the control-data read and the fallbacks;t_oe); every test indm/tools/tests,dm/ios/testsanddm/gfx/tests(test_nsp_mac_app.py: no--languagegives noDMLanguageand noDM_LANG,--langonly when asked, thecontrol.nacpcopy and its fallback);dmhostfor Super Mario Bros. Wonder (NVN), Hades (Vulkan) and Digimon Story Cyber Sleuth (GL); the iOS compile check.tools/dmhostwithoutDM_LANGloggedlanguage: it; an app built with--platform mac-app(no--language) logged the same and started in Italian; withDM_LANG=en-USthe game ran in English.Not checked
One of three independent PRs from the same bring-up; they touch separate code and can land in any order.
Rebased on today's
main(the settings window, #379 / #388)The settings store and window interact with this default:
pack_app.pynow copies the Game language row's default intoDMLanguage; with no--language,settings.pymakes that the game's first language, which would have fixed every multi-language Mac app to it. The branch writesDMLanguageonly when--language/LANGUAGEnamed one (a one-line guard, with a test), so the launcher leavesDM_LANGunset and the host follows the Mac's languages.DM_LAUNCHER=0, a single-language game) and for a Mac-only build's run command. When the window is shown, Play sets every row, soDM_LANGbecomes the row's default, the game's first language, and the window shows that as selected rather than the Mac's. The row would need an "Automatic (the Mac's languages)" option as its Mac default, withLauncherSettings.apply()leaving the variable unset for it. That is a change to the shared Swift model, which I did not make here; happy to add it in this PR or a follow-up, whichever you prefer.settings.pyis fed the packed version'scontrol.nacponly; the base game's fallback (--nacp) reaches the host but not the list.🤖 Generated with Claude Code