Repository navigation
One rules test per front end for every language file (#388 step 3) - #480
Merged
Merged
Conversation
5 of 6 tasks
# 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
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 #479 (stack #459), retarget to main after the ones below merge.
Fix or feature
What and why
Part of #388, step 3.
The language files in
frontend/l10nhad one German test and one French test per front end. They checked their own language only, and a new language had no test at all. Now there is one rules test per front end. It finds the languages in the folder, so a sixth file is checked without a change to the test.The rules, for every file found:
en.jsonandzh.jsonhave the same keys.en.jsondoes not have. A missing key is allowed, it shows English.%@,%d,%ld,%.1f,%%, positional%2$@, and{0}or{name}). A positional placeholder may be reordered, as inlaunch.scaleOfDockedinzh.json._languageis there with a name and locales (lowercase, including the code), and no two files claim the same locale._languagefirst, no duplicates, one entry per line, and the file ends with a newline.Tests:
frontend/Tests/NXCoreTests/LocalizationRulesTests.swift(7 tests)frontend-qt/tests/test_localization_rules.py(7 tests)Removed because the new tests cover them:
testEveryKeyHasAGermanEntry,testFormatPlaceholdersMatchEnglishInCountAndOrder,testEveryKeyHasFrenchText,testPlaceholdersMatchTheEnglishTextand the two placeholder helpers.test_placeholders_match_english_in_count_and_order(German),test_every_row_has_french_and_its_placeholders, and the empty check in the German test.Everything else in the German and French tests stays: the not-left-in-English checks, the text rules and the checks that the catalogs are used.
Checked
swift testinfrontendpasses exceptConsoleTests.testFirstTileRingIsNotClippedAfterScrollingBack(a focus ring in a rendered view, it does not touch localization). Qt tests andtools/testspass. The pre-push hook passes.Screenshots
None, no visible change.
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