Skip to content

iOS shell texts are lines of the language files, its catalogs are generated (#388) - #482

Merged
v0lumehi merged 15 commits into
v0lumehi/l10n-key-checksfrom
v0lumehi/l10n-shell-strings
Nov 2, 2026
Merged

v0lumehi merged 15 commits into
v0lumehi/l10n-key-checksfrom
v0lumehi/l10n-shell-strings

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #481 (stack #459), retarget to main after the ones below merge.

Fix or feature

  • Fix
  • Feature

Feature from outside: not applicable, this is part of the agreed plan in #388.

What and why

Part of #388, step 5.

The iOS shell had its own two string catalogs, Localizable.xcstrings in ShellUI and ShellHost, with English and Chinese only. They were separate from the launchers' texts and could not take a new language without a hand edit. Now the shell's texts are lines of frontend/l10n/<code>.json, next to the launchers' texts.

  • The 126 texts are keys ios.ui.* (ShellUI, 67) and ios.host.* (ShellHost, 59) in en.json and zh.json. The names are plain (ios.ui.performanceOverlay, ios.host.manifestMissing). I did not reuse launcher keys with the same English words. A launcher text can change for the launcher alone, and six of the shared words (Play, On, Off and others) have a different Chinese text in the launcher.
  • tools/l10n_shell_catalogs.py writes both catalogs from the files. The Swift code asks for a text by its English words (ShellStrings.text("Done")), so the catalog key is the English text of the JSON key, with %@ and %lld unchanged. Every language file that has the key adds a localization (zh becomes zh-Hans). The languages are the files of the folder, a new file needs no change in the tool. --check exits 1 when a committed catalog is out of date. Format: sourceLanguage en, version 1.0, no plural variations, state translated.
  • The generated catalogs are byte for byte the ones that were committed, so no text of any language changes and no Swift call changes.
  • Swedish, German and French have no shell texts yet. They show English in the shell, like a missing key in the launchers. Translations can follow as lines in sv.json, de.json and fr.json.
  • ShellDemo keeps its own English-only catalog. Those are demo sample texts, not shell texts.
  • iOS offers a language to the package bundles only when the app declares it in CFBundleLocalizations. The Demo app (project.yml and Gen/Info.plist) now declares en, de, fr, sv and zh-Hans, as tools/try-local already did. The shell app of the engine had en and zh-Hans, so patch 0056 adds the others (fork-only, same as 0055). Patch numbers are renumbered at merge from main's series.
  • Key checks: catalogKeys in frontend/Tests/l10n-key-rules.json lists the two prefixes, so the ios.* keys do not count as unused. The Mac test and the Qt test both read it. The German prose test in the Qt tests skips ios.*, the launcher never shows them.
  • Docs: frontend/README.md, frontend/ARCHITECTURE.md, AGENTS.md and frontend-ios/README.md say where the shell texts live. The "later step of One JSON file per language, read by the Mac launcher, the Windows launcher and the iOS shell #388" notes from The language list comes from the language files (#388, step 2) #479 are gone.

Tests

  • tools/tests/test_l10n_shell_catalogs.py (14 tests): the committed catalogs equal the generated ones, Xcode format, format specifiers kept in every language, English and Chinese have every shell text, a new language file shows up, a duplicate English text fails, and the Demo app, tools/try-local and the engine's shell app declare every language file. It is in the "Patch, engine and release tool tests" step of tests.yml.
  • LocalizationKeyTests and test_localization_keys.py got one test each for the catalogKeys entries.

About #429

I did not fix #429. The English rows on a Chinese device are not a missing catalog entry. A game's settings page (section, label, note, options) is drawn from the game's launcher.json, which is English, and the shell has no table that translates it. The shell's own texts were already Chinese. The plan in #429 builds on the ios.* keys of this step.

Checked

  • Tests: cd frontend && swift test (639 tests, 17 skipped, 0 failures), cd frontend-ios && swift test (110 Swift Testing tests and the XCTest ones, 0 failures), python3 -m unittest discover -s frontend-qt/tests (238, 14 skipped), python3 -m unittest discover -s tools/tests (162), python3 tools/engine.py check (35 patches apply).
  • Visual QA: None, no visible change. The catalogs are unchanged byte for byte.
  • Run on a device or Mac: not run. I did not launch the app or the simulator.

Screenshots

None, no visible change.

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch is fork-only, it lists the languages of this fork's frontend/l10n
  • A change to a launcher view has before and after screenshots above: no view changes
  • No keys, game files or data extracted from a game in the change or the attachments

…#388)

A lookup names only keys en.json has, a key built at run time needs a declared prefix, and a key no source uses fails.
The rules file frontend/Tests/l10n-key-rules.json is shared by the Mac and the Qt test.
Windows showed the key msg.done after a build, it is back in every language with msg.ipaAt.
26 keys no code used, the three opt.* ones and the settings.language.<code> names are removed from every language file.
…re generated (#388)

The 126 texts of ShellUI and ShellHost are now keys of frontend/l10n/en.json and zh.json, under ios.ui. and ios.host.
tools/l10n_shell_catalogs.py writes the two Localizable.xcstrings from the files, with a localization for every language file that has the key.
The generated catalogs are byte for byte the ones that were committed, so no visible text changes and the Swift code stays as it is.
A test fails when a committed catalog differs from what the files give, or when the Demo app, try-local or the engine's shell app do not declare every language file.
Patch 0056 declares de, fr and sv next to en and zh-Hans in the shell app of the engine.
The key checks count the ios.* keys as used (catalogKeys in l10n-key-rules.json).
@v0lumehi v0lumehi added this to the v1.0.2 milestone Nov 2, 2026
@v0lumehi v0lumehi added enhancement New feature or request launcher The NX2Apple launcher app ios iPhone or iPad labels Nov 2, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation windows Windows (the Qt front end) patch-queue Changes the patch queue or the upstream pin ci Workflows and repository tooling labels Nov 2, 2026
@v0lumehi
v0lumehi added this pull request to stack #459 November 2, 2026 06:00
# Conflicts:
#	frontend-qt/nspb_qt/localization.py
#	frontend/Sources/NX2Apple/ContentView.swift
#	frontend/Sources/NXCore/Localization.swift
#	frontend/Sources/NXCore/ShellInstall.swift
#	frontend/Tests/NX2AppleTests/ShellInstallTests.swift
# Conflicts:
#	frontend/Sources/NXModel/BuildStore+ShellRoot.swift
# Conflicts:
#	frontend-qt/nspb_qt/localization.py
#	frontend/Sources/NX2Apple/ContentView.swift
#	frontend/Sources/NXCore/Localization.swift
#	frontend/Sources/NXCore/ShellInstall.swift
#	frontend/Tests/NX2AppleTests/ShellInstallTests.swift
# Conflicts:
#	frontend/Sources/NXModel/BuildStore+ShellRoot.swift
@v0lumehi
v0lumehi merged commit 70a196e into main Nov 2, 2026
15 checks passed
@v0lumehi
v0lumehi deleted the v0lumehi/l10n-shell-strings branch November 2, 2026 17:44
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 ios iPhone or iPad launcher The NX2Apple launcher app patch-queue Changes the patch queue or the upstream pin windows Windows (the Qt front end)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS shell: a game's settings are English on a Chinese device

1 participant