fix(ui): replace code identifiers in the English stat-card copy - #168
Merged
Merged
Conversation
The English pack rendered four stat-card sub-labels as raw code identifiers where the Chinese pack has proper prose: ops.stats.keys.sub.on status=on -> enabled ops.stats.calls.sub usage_records -> usage records admin.emp.stats.admins.sub role=admin -> admin role admin.emp.stats.deps.sub organization -> organization management These were introduced with the language packs (#86) and kept on the English side by the later i18n clean-up (#87), which stripped the English annotation suffixes from the zh pack but left these values as they were. `organization` also collided visually with the value of the adjacent Departments card ("0 departments" + "organization"). Only English values change; the zh pack is byte-identical, so no key, placeholder or parity change is involved (775 == 775).
7 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.
Summary
The English language pack rendered four stat-card sub-labels as raw code identifiers, where the Chinese pack carries proper prose. In the UI this is directly visible as a database dump next to ordinary English copy.
ops.stats.keys.sub.onstatus=onenabledops.stats.calls.subusage_recordsusage recordsadmin.emp.stats.admins.subrole=adminadmin roleadmin.emp.stats.deps.suborganizationorganization managementRendered before/after (EN, ops view):
...Active keys 5 status=on Calls this month 900 usage_records Points in ...→
...Active keys 5 enabled Calls this month 900 usage records Points in ...(EN, admin members stats):
...Admins 1 role=admin Departments 0 departments organization→
...Admins 1 admin role Departments 0 departments organization managementThe last one had a second problem: the sub-label
organizationsat directly under the value of the adjacent Departments card, which itself reads0 departments— so the two cards read as one broken sentence.organization managementmatches the sidebar tab label and separates cleanly.Related Issue
None — the repository has no open issues. This was found by a runtime audit of the language packs and reported here.
Changes
ui/js/i18n.js— 4 English values rewritten to natural copy (zh pack byte-identical)ui/index.html— cache-bust?v=20260911-12→-13(5 references)775 == 775, 0 only-in-zh, 0 only-in-en, 0 placeholder mismatchesScope note: this PR intentionally changes English copy only. Two neighbouring items were deliberately not touched, to keep the change single-purpose and reviewable:
admin.usage.unit.yuan=yuanand the adjacentcallsunit labels (romanization / bare units). Whether English should readyuanorCNYdepends on how the admin models table presents currency (admin.models.col.in=Input $), which is a modelling question, not a translation slip. Worth a separate discussion.admin.models.col.in/out=Input $/Output $— the backend stores a per-modelcurrency, so a hardcoded$may be wrong for the CNY rows.Tests
cargo test— 148 passed, 0 failedcargo fmt --check— cleancargo clippy --all-targets -- -D warnings— cleanVerification evidence
i18n gate on the Node-evaluated real module: 775 == 775, 0 only-in-zh, 0 only-in-en, 0 placeholder mismatches.
A/B runtime harness, baseline (
git archive HEAD ui) vs this branch, both built by the same generator, headless Chrome, measuring the.subelement of each stat card:['platform service OK', 'all registered users', 'status=on', 'usage_records', ...]→['...', 'enabled', 'usage records', ...]['real users', 'balance + gift', 'role=admin', 'organization']→['...', 'admin role', 'organization management']Checklist
fix/...)fix(ui): ...)