Skip to content

fix: add missing translations for sole-trader and search-error strings - #427

Merged
dgjlindsay merged 1 commit into
stagingfrom
doug/company-search-i18n-gap
Sep 3, 2026
Merged

fix: add missing translations for sole-trader and search-error strings#427
dgjlindsay merged 1 commit into
stagingfrom
doug/company-search-i18n-gap

Conversation

@dgjlindsay

Copy link
Copy Markdown
Contributor

Summary

  • Audited every user-facing string in the company-capture component tree (company-capture-component.js, company-search-panel.js, sole-trader.js): mode chips, search aria-label, company-number aria-label, and the sole-trader/search-error messages.
  • Three strings had no row in i18n/{nb_NO,nl_NL,sv_SE}.csv: "Select a different sole trader", "Company search is unavailable right now. Please try again shortly.", and "Could not complete sole trader signup. Please try again." Added machine translations matching the neighbouring rows' register/tone; a human pass is expected later.
  • es_ES.csv does not exist in this repo (never has, and no test references that locale) — the standing 4-locale ruling doesn't apply to this repo as-is. Flagging for Doug rather than adding a locale with no established convention here.

Why this slipped through CI

This repo has no dev/i18n-audit.sh — the closest thing is Test/Unit/I18n/AdminFormCatalogueTest.php and CompanyGateMessageTranslationTest.php, both PHPUnit. AdminFormCatalogueTest only scans admin-side __() calls (Block/Adminhtml, view/adminhtml/templates, Model/Config/*, admin XML forms) — it never looks at view/frontend/web/js/**. CompanyGateMessageTranslationTest checks two specific hardcoded msgids only. Nothing in CI scans frontend-JS translate() calls at all, so a missing row there renders in English silently, with no test failure.

Test plan

  • i18n/*.csv parse cleanly (verified locally: no dup keys, row counts consistent)
  • CI green

Three company-capture-component strings had no i18n row in nb_NO/nl_NL/sv_SE:
"Select a different sole trader", "Company search is unavailable right now.
Please try again shortly.", and "Could not complete sole trader signup.
Please try again." Machine-translated pending a human pass.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: three added CSV rows (nb_NO, nl_NL, sv_SE) match the translate() call sites exactly (company-capture-component.js, company-search-panel.js, sole-trader.js), are alphabetically placed, and introduce no duplicate keys. No critical issues.

Re: the es_ES.csv question raised in the PR description — confirmed the file doesn't exist anywhere in this repo and no test references it, so deferring that to Doug as suggested is reasonable; not a blocker here.

Ready for human approval ✅

@dgjlindsay

Copy link
Copy Markdown
Contributor Author

Self-review (clean round): 9 lines added across 3 CSVs, no other rows touched, no duplicate keys introduced, alphabetical placement preserved. All 3 missing msgids ("Select a different sole trader", "Company search is unavailable right now. Please try again shortly.", "Could not complete sole trader signup. Please try again.") verified against the exact translate() call sites in company-capture-component.js / company-search-panel.js / sole-trader.js. Translations checked against neighbouring rows for register/tone (nl_NL formal "u", terminology matching the existing "Sole trader"/"Search for company" rows). CI green (30/30 checks incl. automated code-review). No outstanding findings.

— by Claude

@dgjlindsay
dgjlindsay merged commit 3442f0c into staging Sep 3, 2026
30 checks passed
@dgjlindsay
dgjlindsay deleted the doug/company-search-i18n-gap branch September 3, 2026 22:15
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