feat: add i18n translation layer with NextUI locale support (FR)#136
Open
foXaCe wants to merge 2 commits into
Open
feat: add i18n translation layer with NextUI locale support (FR)#136foXaCe wants to merge 2 commits into
foXaCe wants to merge 2 commits into
Conversation
Reads NextUI's persisted language code from
/mnt/SDCARD/.userdata/shared/minuisettings.txt and loads the matching
<code>.lang file from /mnt/SDCARD/.system/res/lang/ (the same files
the launcher reads). Missing key → returns the key as-is, so paks
that aren't translated yet show the English fallback rather than
breaking.
UI changes are passive: every visible string was replaced with
i18n.T("ps.<key>") and translations live entirely in NextUI's
shared lang files (see companion PR on LoveRetro/NextUI).
Storefront categories are kept opaque on the wire but mapped to
locale strings client-side via a stable lower-snake-case key
("ROM Management" → ps.cat.rom_management). New categories added
upstream show up untranslated rather than disappearing.
Splash text is locale-specific: the original splash.png is kept for
en, and splash_fr.png is shipped with the French version of
"Fetching Storefront..." baked at the original position in the
same magenta colour. The active locale is checked at startup and
the matching PNG is loaded; falls back to splash.png otherwise.
This was referenced May 23, 2026
The download manager UI was the last bit of Pak Store rendering in English on a French system — gabagool baked Close / Cancel Download / Show Speed / Hide Speed into download.go. Adds 5 i18n.T() calls passing the localised strings through the new DownloadManagerOptions override fields (companion PR: BrandonKowalski/gabagool#18). The 'Downloading <pak> <ver>...' title is now built via i18n.Tf("ps.download.title_fmt", ...) too. go.mod is bumped to point at the gabagool fork branch until LoveRetro#18 merges; once it does, this should be reverted to the upstream tag.
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.
Summary
Adds an i18n layer that reads NextUI's already-persisted language code from
minuisettings.txtand translates every visible UI string in Pak Store. Ships a French translation as the first non-English locale — adding another language is a matter of dropping a<code>.langfile in NextUI's shared lang dir and (optionally) asplash_<code>.pnghere.Companion PR on NextUI core ships the
ps.*keys (English + French): LoveRetro/NextUI#735How it works
internal/i18npackage: ~140 LOC, no deps. Reads/mnt/SDCARD/.userdata/shared/minuisettings.txtforlanguage=, loads/mnt/SDCARD/.system/res/lang/en.langas baseline +<code>.langon top. Missing key → returns the key, so absence is a no-op rather than a crash. Decodes\n/\t/\\escapes so multi-line confirmation messages can sit on a single line in the.langfile.i18n.T(key)andi18n.Tf(key, args...)(sprintf wrapper) replace the hardcoded strings everywhere —app/,ui/,state/,utils/.i18n.Active()exposes the current code so non-string assets can be locale-aware too.UI coverage
Every visible English string was replaced:
Select/Back/Quit/Cancel/...) viaui/footer_helpers.go%s Updated!→i18n.Tf(\"ps.update.success_fmt\", name))Are you sure...?,Nevermind,Yes)Unzipping,Uninstalling,Failed to download, ...)On/Off,Match Device/All,Error/Info/Debug)Storefront categories
Categories come from the storefront JSON which lives upstream and is shared across locales. Rather than maintaining a parallel translated JSON, they are mapped client-side:
\"ROM Management\"→ keyps.cat.rom_management→ "Gestion des ROM". Unknown categories (e.g. a new one added upstream that lacks a key) fall through to their original English name, so the feature degrades gracefully.Splash
Fetching Storefront...is baked intoresources/splash.pngas part of the image, so it cannot be translated by an overlay (the original splash leaves no whitespace for one). Two options were considered:--messagetogabagool.ProcessMessage: overlay sits on top ofPak Storetitle and renders in white-on-white. Ugly.Went with the second approach:
resources/splash.pngkeeps the original English version,resources/splash_<code>.pngships the localised version (heresplash_fr.pngwithChargement du Storefront...baked at the same Y position in the same magenta#9b2255, transparent background preserved).splashForLocale()picks the right file at startup with a fallback to English.Files
internal/i18n/i18n.goapp/pak_store.goi18n.Init()at startup,splashForLocale()helperapp/states.go,ui/*.go,state/helpers.go,utils/functions.goi18n.T()/i18n.Tf()resources/splash_fr.pngtaskfile.ymlsplash_*.pngalongsidesplash.png.gitignore/pak-storeat repo rootWhat's not in this PR
Test plan
task build(Dockerfile + buildx for linux/arm64) — same path as CI.language=frinminuisettings.txt.Chargement du Storefront...in the original magenta on transparent bg (no white band).language=enor no lang file present.