Repository navigation
F182 B5: i18n sweep — records & export (History, Reports, Audit, Export) - #248
Merged
Merged
Conversation
added 4 commits
July 27, 2026 18:28
Adds the English-first `history` namespace (53 keys) and wires every
render-context string through useTranslation("history")'s t(), every
imperative event-handler/mount-effect message through the i18n.t()
singleton, and the entry-status pills (Voided/ManagerAdjusted->Adjusted/
Locked incl. its {{time}}-interpolated tooltip/Submitted/Draft) as their
own bespoke history:status* vocabulary, distinct from enums:status per
the task brief. i18n:scan (src/routes src/components) drops from 398 to
366. es/tl catalogs and TRANSLATED_NAMESPACES are untouched.
Adds the `reports` namespace (English-only) to en.ts and wires
ReportsPage's production table, admin-gated money section, and prose
to useTranslation("reports")/<Trans>, reusing common:loading. Also
adds ReportsPage.test.tsx (0% coverage previously) covering render
data, the isAdmin fetch/render gate on both sides, and i18n wiring
including {{count}} interpolation and <Trans> component mapping.
…enums (#182) Adds two new typed enum families to the shared enums module — auditAction (28 capture-point codes) and entityType (13 values) — with es/tl machine-drafted labels, and replaces AuditPage's hardcoded local action list with the new AUDIT_ACTION_VALUES tuple. Externalizes the page chrome (heading, filters, table headers, empty/loading state) into an English-first `audit` namespace.
Task 30 (B5): new English-only `export` namespace (27 flat keys — 7 page-chrome strings plus one identity key per EXPORT_DATASETS member, so the dataset picker's labels route through the catalog too). CSV column headers/file contents stay server-side and untouched; download filenames stay raw. es/tl unchanged (not in TRANSLATED_NAMESPACES).
Closed
20 of 21 tasks
Machine-drafts Spanish and Tagalog for the B5 screen namespaces (History/Reports/Audit/Export) and adds them to TRANSLATED_NAMESPACES so Spanish/Tagalog mode stops falling back to English on those pages. catalogParity.test.ts enforces key/placeholder/tag parity; marked pending native review, same convention as the prior settings/users/ expenses/customers backfill.
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.
B5 — records & export. Sixth batch of the #182 string sweep. Externalizes the four records/export screens to the catalog, with es/tl (translate-now policy), plus the audit action/entity friendly-labelling.
es/tl included (translate-now)
All four screen namespaces (
history53,reports23,audit11,export27) ship machine-drafted Spanish + Tagalog and are inTRANSLATED_NAMESPACES— so Spanish/Tagalog mode renders translated on these pages. Plus theenums:auditAction.*/enums:entityType.*labels (below). All new es/tl marked// machine-drafted (#182) — pending native review;catalogParityenforces en/es/tl parity (placeholders{{time}}/{{count}}/{{status}}+<strong>tags verbatim). This drops the earlier English-first deferral for these screens (a separate PR backfills B1–B3).Screens
history(English-first). Entry-status pills (Draft/Submitted/Locked/ManagerAdjusted→"Adjusted"/Voided) kept in thehistorynamespace — entry lifecycle is a distinct vocabulary from the sharedenumsstatus family, so it is NOT added to enums.history:lockedAt "Locked {{time}}"interpolation;StatusBadge status=stays raw, translatedlabel=added.reports(English-first) + a NEW test file (this screen had 0% coverage). Counts via{{count}}interpolation (no plurals); admin-gated profit/expense section tested on bothisAdminbranches. Global coverage rose (stmts 85.55→86.95, br 75.26→76.85, fn→80.64, ln→90.31).enums.ts—auditAction(28 codes) +entityType(13) — with human labels ("DailyEntry.Adjust" → "Daily entry adjusted"), compile-time exhaustive (a renamed value is aTS2741) with raw-value fallback for unlisted server codes. Labels translated es/tl (enumsis a translated namespace — parity enforced). The local hardcodedactionsarray is replaced byAUDIT_ACTION_VALUES(single source of truth, part of the Tech debt: magic strings — duplicated role/claim constants, untyped SPA status strings #84 magic-strings debt). Audit page chrome →auditnamespace (English-first). Filter optionvalue=stays the raw code; option text + cells use the label helpers.export(English-first). Dataset picker labels via a compile-checked dynamict(\dataset.${d}`)over the client-definedEXPORT_DATASETSconst (identity values; a missing key is both aTS2345and a runtime-test failure). **CSV headers/file contents are server-side (CsvExport.cs`) — untouched**; download mechanics + filenames unchanged.Guarantees held
TRANSLATED_NAMESPACES(the 4 screen namespaces + the 41enums:auditAction.*/enums:entityType.*label keys) — key sets equal, placeholders/tags verbatim, machine-drafted pending native review.i18n.language/Intlformatting in any screen;formatMoneyuntouched.i18n.addResourceoverride technique (each mutation-probed).Testing / review
npm run test997 green (incl. catalogParity for the 41 new enum keys); coverage above floors and rising;npm run typecheckclean;npm run buildsucceeds. Each screen individually reviewed (spec + quality, empirical probes); whole-branch review (opus comprehensive — READY-WITH-MINORS).Follow-up filed
The whole-branch review surfaced a pre-existing audit-log gap (not introduced here): the server emits 31 audit action codes but the client list carries 28 — missing
Account.SetLogo/RemoveLogo/UpdateSettingsand theFarmLogoentityType (renders raw via fallback). B5 faithfully ported the prior 28-code list, so this is not a regression. Filed as #247 (tied to the #84 magic-strings debt) rather than scope-widening this port.Not in scope
Native-speaker review of the machine-drafted es/tl (stays open on #182); the audit action-code reconciliation (#247); the B1–B3 es/tl catch-up (separate PR); B6 (Help — the final batch).