Skip to content

fix(i18n): label the contact name field with its own key - #447

Merged
ArnasDon merged 1 commit into
ArnasDon:mainfrom
opastorello:fix/contact-name-label
Jul 29, 2026
Merged

fix(i18n): label the contact name field with its own key#447
ArnasDon merged 1 commit into
ArnasDon:mainfrom
opastorello:fix/contact-name-label

Conversation

@opastorello

Copy link
Copy Markdown
Contributor

Summary

The contact Details tab labels the name field with the company key, so it renders "Company" above the name input — and "Company" again above the actual company input. Wrong in English too, not just ko.

What changed

src/components/contacts/contact-detail-view.tsx:491 read:

<Label>{t('company', { fallback: 'Name' })}</Label>
<Input value={editName} onChange={(e) => setEditName(e.target.value)} />

The namespace is Contacts.detailView, so that resolves to Contacts.detailView.company"Company" / "회사". There is no Contacts.detailView.name key in either catalogue; the { fallback: 'Name' } looks like it covers that, but next-intl's second argument is ICU values, not options — confirmed against the installed 4.13.1 types, where TranslateArgs is [values?, formats?]. So it was silently discarded and the wrong label won.

  • messages/en.json — add Contacts.detailView.name = "Name".
  • messages/ko.json — add "이름", the term already used for name in six other places in the file.
  • contact-detail-view.tsx — point the label at t('name'), and drop the two decorative fallback arguments (:465 had one too, harmless there since the key exists, but it reads like a guard and isn't one).

Worth noting this is a class of drift the parity test from #419 can't catch: both catalogues have company, so key parity is satisfied — the bug is the call site reaching for the wrong key. Flagging it in case it shapes what else is worth guarding.

Test plan

  • npm run typecheck clean.
  • npm run lint — 39 warnings, same as main, no new ones.
  • npm run build succeeds.
  • npm testsrc/i18n/messages.test.ts passes both directions (no missing keys, no orphans); the 5 failures in currency / date-utils are the known non-UTC/ICU artifacts of a local machine and are identical on main.
  • Script-checked every t('…') in the touched file against both catalogues: 34 keys, all resolving in en and ko.
  • Not exercised in a browser — the Details tab needs an authenticated session against a live Supabase project. The change is a label key swap covered by the checks above.

Note: messages/en.json, messages/ko.json and contact-detail-view.tsx already fail prettier --check on main, so I left formatting alone rather than bury a two-line fix in a reformat. My additions follow the surrounding style.

Related

Follows the { fallback: … } observation in #418.

The Details tab rendered `t("company")` above the name input, so the
panel showed "Company" twice and the name field carried the wrong
label — in English as well as Korean. There was no
`Contacts.detailView.name` key at all; the call papered over it with
`{ fallback: "Name" }`, which next-intl ignores (the second argument
is ICU values, not options).

Add the missing key to both catalogues, point the label at it, and
drop the two decorative `fallback` arguments so the remaining call
sites read as what they are.
@ArnasDon
ArnasDon merged commit a495cf7 into ArnasDon:main Jul 29, 2026
1 check passed
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.

2 participants