feat(libSceSystemService): take the console language from the host with ANYPS5_LANGUAGE=auto #12752
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12752"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T07:41:53Z.
What
ANYPS5_LANGUAGE=auto(any letter case) takes the console language from the host operating system's language. Unset, empty and every integer 0..30 behave exactly as before (read at each query);autois the only new value, and any other text is still refused at the first language query with the error that names the variable, which now readsmust be a console language number from 0 to 30 or auto, not "...".How it works, in
core/libs/prx/libSceSystemService/LanguageLocale.hpp(header only, table driven, pure apart from the host sources):ParseTagreads BCP-47 tags (en-US,pt-BR,zh-Hant-TW,es-419),NormalizePosixLocalereads POSIX names (en_GB.UTF-8@euro,sr_RS@latin,C,POSIX),ParseLocaleaccepts either.CorPOSIXlocale gives English (United States) and one stderr line naming the locale.LC_ALL, thenLC_MESSAGES, thenLANG, first non-empty;LANGUAGEentries first under a real locale), Windows (GetUserDefaultLocaleName), macOS (CFLocaleCopyPreferredLanguages, linked through an interface target).SystemServiceConsoleLanguageresolvesautoonce per process (function-local static), so parameters 1 and 400, the trophy texts and, through parameter 1, the user service keyboard type and the IME keyboard type all see the same value.autois case-insensitive; the integer form stays strict.env_reference --checkpasses) and three statements in docs/dev/debt/libSceSystemService.md (mapping is an unmeasured host-side convenience; the regional choices; sources run on Linux only). Language ids and names are the repo's own list (OpenOrbis sys_service.h at 06fcf7fd108fa080035cdd3259ed22eb07e0508c, cited in the debt doc).Commits (39): parser, POSIX normaliser, either-form parse, lookup plus each mapping group, fallback rules, POSIX/Windows/macOS sources, CMake, resolver,
autoparsing, error text, each followed by its test; consumer tests (user service, keycode, trophy tag round trip); docs one per file or statement.Overlap with open PRs: #9345 (ANYPS5_USER_NAME) also edits docs/dev/ENVIRONMENT.md and docs/user/USAGE.md (different rows and paragraphs; the ANYPS5_LANGUAGE row and paragraph are only touched here). #9586 edits libSceSystemService CMakeLists.txt, Export.cpp, SystemService.hpp and docs/dev/debt/libSceSystemService.md: here CMakeLists.txt gets a new interface target and test blocks, SystemService.hpp the
SystemServiceHostLanguagefunction, theautoline and the error text, and the debt doc three new entries after the language entry. Export.cpp and PendingExports.cpp are not changed. No open PR implementsauto.Tested
Linux x86_64 (Debian 12, kernel 6.1), GCC 12, throwaway archive build,
BUILD-EXIT 0.system_service_language_locale(host-only, 200+ tags: every console language id 0..30 has a tag, regional pairs, scripts, case variants, POSIX codesets and modifiers,C,POSIX, empty, garbage, languages with no console entry, POSIX precedence with injected environments, resolver with injected sources and notices) andguest_system_service_language_auto_0..12(end to end throughsceSystemServiceParamGetIntparameters 1 and 400 andSystemServiceConsoleLanguagewith 13 host environments: precedence,LANGUAGE,C, nothing set, unlisted language; later host change does not change the answer; integers, empty and unset still work afterauto; near misses such asauto,autoo,-autoand the integers' malformed forms refused with the new text; exactly the expected number of notices). Consumers:guest_user_serviceandguest_convert_keycodegain anautocase (German keyboard / IME type),np_trophy2_packagechecks that all 31 trophy tags map back to their console language. All passed, each under 0.3 s.b433c40f2f) vs branch, per test: guest_convert_keycode, guest_convert_keycode_title_{oversized-id,oversized-title,cusa,ppsa,malformed-json,missing}, guest_nptrophy2, np_trophy2_package, guest_system_service_language, guest_user_service, guest_user_service_user_name, guest_user_service_lifecycle: 13/13 passed on both.in, reversed LC_* order, LANGUAGE under C, empty entries, notice text and count). End to end:autoforced to 1 fails all 15 tests; resolving at each call (no once) fails 14 of 15 (case 8, a Japanese host, passes by construction); prefix match ofautofails the near-miss check. Not negative-controlled: the Windows and macOS branches (not built), the debt and doc text, the macOS CMake link.check_conventions.py --base upstream/main,git diff --check upstream/main,test_public_headers.py --audit-only --manifest /tmp/ph_langauto.json,env_reference.py --checkall clean. Rebased on upstream/main10bec5c322(the last move touched none of these files).NOT RUN: Windows (the
GetUserDefaultLocaleNamebranch and the MinGW link of the host-only test, which usesconfigure_host_test_executable, are unbuilt), macOS (the CoreFoundation branch and framework link are unbuilt), a real non-English host (Linux tests only set environment variables), a console, any title. The resolver is inline, so a library with its own copy (a separate DLL on Windows) resolves again and could print its own fallback line; reasoned, not run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T20:02:41Z.
Review: COMMENTED
Correction (2026-11-01): this review demanded a title for a PR where no title can supply one. CONTRIBUTING allows
Unblocks: none. The technical points below are unaffected.No title ID and no log line: the description names none and
Unblocksis empty. The default (ANYPS5_LANGUAGEunset or an integer) is unchanged, so nothing onmainis affected until a user opts in, which makes this a convenience feature rather than a fix for a title.CorPOSIXlocale gives English (United States) and one stderr line", and that "a recognised language with no row for the region uses its main row". Those are fallbacks that return a plausible value instead of throwing, and upstream has been rejecting those even when logged. If the host locale cannot be mapped, the exact-or-throw choice is to throw namingANYPS5_LANGUAGE, which is what the integer path already does for bad text.GetUserDefaultLocaleName) and macOS (CFLocaleCopyPreferredLanguages, a new framework link) paths. The description says only the Linux sources are tested; the Windows and macOS branches and the CoreFoundation link are unbuilt. I would not take unbuilt platform code intolibSceSystemService.What would make this reviewable: a title that reads the language and misbehaves on
mainwith the integer variable, with a log line, or a reason a user cannot just setANYPS5_LANGUAGE=1once.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:58:08Z.
Review: COMMENTED
Reviewed — three review points need an answer; the fallbacks are confirmed
CnRJay asks for exact-or-throw on unmapped host locales and for a source of the regional table; the head falls back to English (United States) with one notice line, and the table cites no source.
What I ran
Live head:
84fd495ba9(OPEN, same as the batch file). Read the comments and reviews withgh api(repos/boykopovar/AnyPS5/issues|pulls/12752/...). Read files withgit -C /marc/AnyPS5 show 84fd495b…:<path>: LanguageLocale.hpp, CMakeLists.txt, docs/dev/debt/libSceSystemService.md, CONTRIBUTING.md. Read the hosted check rollup withgh pr view. Nothing was built or run.Results
Findings
MatchLocalereturnsEnglishUsfor an unrecognised tag (LanguageLocale.hpp:292),CandPOSIXgive no locale (L248), andResolveHostLanguagelogs one notice and returns English (United States) (L365-L373).GetUserDefaultLocaleName, L322-L334) and macOS (CFLocaleCopyPreferredLanguages, L336-L350) branches exist, and the CMake target links CoreFoundation (CMakeLists.txt L3). The hosted Windows job passed; it does not build the macOS branch.none.Sources
github.com/boykopovar/AnyPS5@84fd495ba9/core/libs/prx/libSceSystemService/LanguageLocale.hpp (L292-L292)github.com/boykopovar/AnyPS5@84fd495ba9/core/libs/prx/libSceSystemService/LanguageLocale.hpp (L365-L373)github.com/boykopovar/AnyPS5@84fd495ba9/core/libs/prx/libSceSystemService/LanguageLocale.hpp (L322-L350)github.com/boykopovar/AnyPS5@84fd495ba9/docs/dev/debt/libSceSystemService.md (L31-L31)github.com/boykopovar/AnyPS5@84fd495ba9/CONTRIBUTING.md (L66-L66)Not verified
ConsoleLanguageForTag) was not read.