Skip to content

F182 B3: i18n sweep — inventory domain (Inventory, Products, Stock, Flocks) — stacked on #239#240

Merged
mforce merged 5 commits into
mainfrom
f182-i18n-b3-inventory
Jul 27, 2026
Merged

F182 B3: i18n sweep — inventory domain (Inventory, Products, Stock, Flocks) — stacked on #239#240
mforce merged 5 commits into
mainfrom
f182-i18n-b3-inventory

Conversation

@mforce

@mforce mforce commented Jul 27, 2026

Copy link
Copy Markdown
Owner

B3 — inventory domain. Fourth batch of the #182 string sweep. Externalizes the four inventory-domain screens to the catalog, English-first, wiring their closed-vocabulary displays through the B0 typed enums helpers.

Base main. B1 (#238) + B2 (#239) merged; B3 rebased directly onto main (2026-07-27) — conflict-free, MERGEABLE. Fully behavior-preserving — B3 has zero intentional visible-text changes (every enum label is identity to its raw value). i18n:scan on src/routes+src/components: 707 → 531.

Screens externalized (English-only namespaces)

  • InventoryPageinventory (~60 keys) — items, categories, movement ledger, correct-stock dialog. Category → inventoryCategoryLabel; the ledger movement cell → inventoryMovementLabel; Active/Inactive → statusLabel. The correct-stock Type picker's decorated labels ("Adjustment (±)", "Discard (write-off)") stay as screen copy (2 tests prove the picker is not routed through the enum helper).
  • ProductsPageproducts — product catalog + packed-unit conversions; status via statusLabel (table badge + packed-units cell); unitCode/defaultUnit/names stay raw data; Eggs per {{unitCode}} interpolates the raw value.
  • StockPagestock — by-grade balances → lots → movement ledger; movement cell via stockMovementLabel (8 values).
  • FlocksPageflocks — roster + bird ledger; movement (picker + ledger) via flockMovementLabel, lifecycle status via statusLabel; names/breeds raw.

Guarantees held

  • es/tl byte-unchanged across all commits; the 4 namespaces are en.ts-only, not in TRANSLATED_NAMESPACES — parity green.
  • Every enum label is identity to its raw value → no visible text moved anywhere in B3.
  • StatusBadge status= stays raw (pill tint unchanged); only the translated label= is added.
  • Formatting stays farm-locale-driven — zero i18n.language/Intl in any screen; formatting-independence guard passes.
  • Free-form data (item/product/flock names, breeds, unitCode, lot numbers) stays raw. No common atom duplicated.

Testing / review

Wiring tests use the i18n.addResource override technique (a hardcoded literal fails — verified by reverted mutation probes on each screen). npm run test 838 green; coverage above the (unchanged) floors — no locked path touched; npm run typecheck clean; npm run build succeeds. Each of the 4 screens was individually reviewed (spec + quality, with empirical probes); then a whole-branch review (Claude comprehensive — READY, zero findings).

Not in scope

es/tl for these screens (deferred native-review pass, #182); the sale-unit vocabulary staying raw English (documented B0 deferral); B4–B6.

Base automatically changed from f182-i18n-b2-dailyops to main July 27, 2026 07:08
mforce added 5 commits July 27, 2026 00:09
Move every user-facing string in InventoryPage.tsx into a new flat
`inventory` namespace in en.ts (English-only, 60 keys), following the
Screen Externalization Pattern from B1/B2. Wires category and status
displays through the B0 enum helpers (inventoryCategoryLabel,
statusLabel), and the movement ledger's Type cell through
inventoryMovementLabel — while keeping the Correct-stock dialog's
decorated Type picker options ("Adjustment (±)", "Discard (write-off)")
as plain screen copy, since that text is not the ledger's identity
label. All enum families are identity-mapped in English today, so the
retrofit is text-preserving.

Adds 11 i18n-wiring tests (i18n.addResource override technique) on top
of the unchanged, still-green functional suite, including a pair of
tests that prove the adjust-type picker reads screen copy rather than
the movement enum. i18n:scan count drops from 707 to 645.
Task 17 (batch B3, the last B3 screen): moves every user-facing string in
ProductsPage.tsx into a new flat `products` namespace in en.ts (English-only,
not in TRANSLATED_NAMESPACES). Wires both the products table's StatusBadge
and the packed-unit table's plain-text status cell through the shared
statusLabel enum helper; unitCode/defaultUnit and product/grade names stay
raw as free-form farm data. Adds i18n.addResource wiring tests covering the
heading, button labels, both status-enum sites, the two data-interpolated
templates (price-with-currency label, eggs-per-unit dialog title), and the
price-precision validation message.
Adds the `stock` namespace (English-first, not in TRANSLATED_NAMESPACES)
and wires the movement ledger's Type cell through the B0
stockMovementLabel helper. Grade/lot names, dates, and quantity/delta
values stay raw farm data.
Adds the `flocks` namespace (English-first) and wires the bird-ledger
movement-type select/cells through flockMovementLabel and the status
badge through statusLabel — the last B3 screen of the i18n sweep.
@mforce
mforce force-pushed the f182-i18n-b3-inventory branch from 14a6417 to 51ea767 Compare July 27, 2026 07:10
@mforce
mforce merged commit efda6d5 into main Jul 27, 2026
7 checks passed
@mforce
mforce deleted the f182-i18n-b3-inventory branch July 27, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant