Repository navigation
Conversation
Add Simplified Chinese UI with runtime language switch; read tune data in metric and Default units
|
Thanks for the time you put into this. I'm closing it because it doesn't follow CONTRIBUTING.md. In #235 I approved a draft PR for Simplified Chinese UI support, linked to that issue, with source changes only. This PR is not a draft, doesn't reference the issue, and adds two things that were never approved: a rewrite of the tune unit reader and a second installer script. The scope and contributor-rights boxes in the checklist are unchecked, the full Release test suite wasn't run (three existing tests fail with these changes), and there is no CHANGELOG entry. The tune changes loosen checks that are meant to fail closed: the profile index bound goes from 8 to 64 based on one observation, an unreadable preference now falls back to imperial, and unit IDs 40, 42, 55, 15, 16 and 61 are mapped from a table instead of captures. I would need a captured fixture for each unit before considering it. The new units also never get a label in the UI, because
Additionally:
If you want to try again, please read CONTRIBUTING.md first and open a new draft PR that contains only the localization change and links #235. The tune reader change would need its own issue and approval before any code. |
|
|
Thanks for the detailed review — agreed on all points. I'll leave this PR closed and open a new draft PR from latest main with only the localization change, linked to #235, with the checklist completed, a CHANGELOG entry, and the full Release suite run. I'll drop the tune reader rewrite and the separate installer; the tune unit work will be proposed separately with captured fixtures. I'll also address the tooltip/source tracking, reverse-map, user-data, English no-op, hotkey, HeaderBrand, and dictionary issues you listed. |
Purpose
Read current-car tune data in any unit system. The Tune page used to require Forza to be set to imperial units; with metric units, or with the game's "Default" unit option, it could not read the car. This change also adds an optional Simplified Chinese UI that keeps English as the default and the source language.
What this fixes
Root cause and solution
Tune reading had three separate problems:
TuneDecoderonly mapped the imperial unit IDs (psi 41, lb/in 54, in 14, lb 60), so every metric unit becameUnsupportedUnit.InvalidConversion, hiding every value that did read.UnitProfilebecause the active locale-profile index is 10 and the reader only accepted 0–7.Fix:
TuneDecoder.TryUnitDefinitionnow also maps bar 40, kPa 42, N/mm 55, kgf/mm 56, cm 15, mm 16 and kgf 61.ResolveUnit(quantity, unitId, factor)identifies an unknown scale unit by comparing the game's own conversion factor with the anchors captured in the shipped fixtures (psi1,39.37007141113281m→in,2.2046000957489014kg→lb, tolerance 1e-3). If that fails, the value still reads and only the label is dropped (TuneUnit.GameDefined).UnsupportedConversion, andInvalidConversionis reserved for an ID outside the game's 0–127 table.NativeTuneCaptureaccepts locale-profile indices 0–63 and falls back to the imperial row when the profile's preference is not a table row.TunePresentation.CaptureStatuslists unit IDs it could not name.The language layer is presentation only: English strings, settings keys, logs and protocol values are unchanged. A dictionary is embedded as a resource and applied at runtime, with three entry points (Wisp mark in the title bar, Appearance → UNITS / Readouts → Language,
Ctrl+Shift+L). The choice is stored in settings and re-applied at startup; switching back restores the original English. Pages that are realised on demand are re-translated when their selector changes, and cached-but-detached pages are reached through a weak registry.Validation
dotnet test tests/Wisp.Core.Tests --filter TuneDecoderTests→ 37 passed, 0 failed.dotnet test tests/Wisp.App.Tests --filter Tune→ 432 passed, 0 failed.Built Release x64 (self-contained single file) and exercised the UI on Windows 11: English default, switch to Chinese, navigate every page and back, switch to English, restart and confirm the saved choice.
The change is within the approved scope.
The change improves usability, functionality, feel, reliability, or maintenance, or fixes a verified bug.
I have read and agree to the contributor-rights terms in
CONTRIBUTING.md.Regression coverage has been added or updated where appropriate.
Steam and Xbox app / Microsoft Store impacts, checks, and outstanding gaps are recorded separately as required by
docs/VALIDATION.md.The complete Release test suite passes.
No credentials, personal data, machine paths, game binaries, save data, private captures, or generated output are included, except matching shader bytecode for an approved shader change described in
docs/SHADERS.md.User-facing changes are recorded in
CHANGELOG.md.Native HUD assets are unchanged, or their distribution rights, provenance, and hashes are documented.
Outstanding validation
UnitProfileobservation comes from a single Microsoft Store build (3.483.970.0). The Steam path was not re-checked against a metric or "Default" unit setting.kgf/mm, factor0.1019716) come from the FH6 tune unit table rather than a captured sample; a capture would confirm them.CHANGELOG.mdentry was added; I left release-note wording to the maintainer.