Repository navigation
Check that the code and en.json use the same keys, in both front ends (#388) - #481
Merged
Merged
Conversation
3 of 6 tasks
…#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.
v0lumehi
force-pushed
the
v0lumehi/l10n-key-checks
branch
from
November 2, 2026 17:14
8359898 to
1349817
Compare
3 of 4 tasks
5 of 6 tasks
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.
Stacked on #480 (stack #459), retarget to main after the ones below merge.
Fix or feature
What and why
Part of #388, step 4.
Nothing checked that the keys in the code and the keys in
en.jsonare the same. The Windows launcher showed the raw keymsg.doneafter a successful build, becausec198d056removed it from the files whileui.pystill asks for it. Now there is one key test per front end, both read the same rules filefrontend/Tests/l10n-key-rules.json.The rules:
t("k"),loc.t("k"),L10n.string("k", ...),L10n.table["k"]in Swift,t('k')andself.m.t('k')in Python) is inen.json."fail.\(kind).what",f'fail.{kind}.risk',"launch.set." + env) starts with an entry ofdynamicKeysin the rules file. Every entry has at least one key inen.jsonand a string in the sources that starts with it.en.jsonthat no source mentions, literally or under adynamicKeysentry, fails.unusedAllowedin the rules file takes a key with the reason. It is empty now.Tests:
frontend/Tests/NXCoreTests/LocalizationKeyTests.swift(6 tests)frontend-qt/tests/test_localization_keys.py(6 tests)What it found, fixed in all five language files (sorted, flat, one entry per line):
msg.doneandmsg.ipaAt, used byui.py. Added back.msg.doneis now short ("Done", "完成", "Klart", "Fertig", "Terminé") because the old text promised three steps the Windows window does not have.btn.build,btn.outDir,build.compatibility,build.details,build.files,build.output,build.resultIOS,build.resultMac,console.batteryUnknown,console.brand,console.connectedNextPlayer,console.fullscreen,console.mergeEach,console.playerMode,console.setup,dev.expiryExpiredShort,dev.expiryShort,dev.expiryTodayShort,dev.reinstall,dev.saveIPA,dev.signedApp,library.buildForMac,prog.empty,settings.appNote,settings.appNote2,shell.copyContinue.opt.macNoBc,opt.note,opt.title, and the fivesettings.language.<code>names that The language list comes from the language files (#388, step 2) #479 left behind (the picker reads the name from_language). The converter script is untouched.Other changes:
settings.language.<code>or other removed keys now useLang(code).nameor drop the key from their lists. The German test of the language names is one test now.frontend/Sources/and the rules file too, because the Qt test reads the Swift sources.frontend/README.mdsays how the key rules work.The iOS shell texts are not part of this step (step 5).
Checked
swift testinfrontendpasses exceptConsoleTests.testFirstTileRingIsNotClippedAfterScrollingBackin one full run. It passes alone and in the other full run, so it is flaky and does not touch localization. Qt tests (237) andtools/tests(148) pass. The pre-push hook passes.Screenshots
None, no visible change. The Windows build result line shows "Done" instead of the raw key, I did not capture it.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#..., orpendinguntil that PR is open