Skip to content

fix(i18n): resolve 48 t() calls referencing missing EN locale keys - #329

Merged
krisarmstrong merged 1 commit into
mainfrom
fix/i18n-missing-keys
May 27, 2026
Merged

fix(i18n): resolve 48 t() calls referencing missing EN locale keys#329
krisarmstrong merged 1 commit into
mainfrom
fix/i18n-missing-keys

Conversation

@krisarmstrong

Copy link
Copy Markdown
Collaborator

Summary

Stem had 48 t() call sites referencing keys that didn't exist in
the EN locale JSON. i18next's fallback semantics (second arg to
`t()`) showed the key as English text so users didn't see broken
UI — but ES translations never resolved, leaving the Spanish
version permanently showing English for these labels.

Surfaced by `check-keys.py` landing via PR #327; cleanup of the
backlog so the `--ratchet` flag can eventually be dropped from CI.

Two-pronged fix

(1) Namespace prefix corrections (24 call sites)

Keys actually exist in `settings.json` but t() calls referenced them
via the default `common` namespace. Fixed by changing literal call
sites to use the `settings:` cross-namespace prefix:

```diff
-t('settings.interface.title', 'Interface')
+t('settings:interface.title', 'Interface')
```

Affected: SettingsDrawer, HeaderInterfaceSelector, InterfaceSection,
ModeSection, ReflectorSection, RFC2544Section, RFC2889Section,
RFC6349Section, Y1564Section, Y1731Section, MEFSection,
TrafficGenSection, TSNSection.

(2) Missing keys added to locale JSON (24 new keys + ES)

common.json:

  • `accessibility.{closeSettings, openHistory, refreshInterfaces, selectProfile}`
  • `interface.{networkInterfaces, noInterfaces, select}`
  • `profile.{current, manage, noProfiles, select}`
  • `tooltips.header.{refresh, history, help, settings, logout}`
  • `status.{clickToReconnect, tapToReconnect, tapToReconnectHint}`

settings.json:

  • `viewModuleHint`, `viewStandardHint`
  • `tests.{rfc2544, rfc2889, rfc6349, y1564, y1731, mef, trafficgen, tsn}.title`
    (8 test category headings)

setup.json:

  • `buttons.copyTooltip`

ES translations follow `I18N_TRANSLATION_MEMORY.md` (formal `usted`,
sentence case, glossary terms preserved verbatim — Reflector, MEF,
RFC numbers, Y.1564 etc. stay English).

Test plan

  • `tsc --noEmit` — clean
  • `biome check` — clean
  • `vitest run` — 136 passed (no regressions)
  • `check-keys.py` strict — was 48 errors, now 0
  • `./scripts/i18n/validate.sh --ratchet` — OK with 4 warnings
    (pre-existing fallback patterns + heuristic JSX flags + version
    pin)

Follow-up

  • The 355 `t('key', 'fallback')` patterns the validator still warns
    about are a separate concern (task Docs mismatch: Implementation spec module paths differ from code layout #45 sibling).
  • Drop the `--ratchet` flag from
    `.github/workflows/ci.yml`'s `check_key_usage` invocation in a
    separate PR once the fallback-pattern cleanup also lands.
  • The 329 same-pattern bugs in seed (PR #1203 surfaced them) will
    get the same fix in a sibling PR.

Stem had 48 t() call sites referencing keys that didn't exist in
the EN locale JSON. i18next's fallback semantics (second arg to t())
showed the key as English text so users didn't see broken UI — but
ES translations never resolved, leaving the Spanish version
permanently showing English for these labels.

Surfaced by check-keys.py landing via PR #327; cleanup of the
backlog so the --ratchet flag can eventually be dropped from CI.

Two-pronged fix:

(1) Namespace prefix corrections (24 call sites) — keys actually
exist in settings.json but t() calls referenced them via the
default common namespace. Fixed by changing literal call sites to
use the settings: cross-namespace prefix:

  t('settings.interface.title', 'Interface')
    → t('settings:interface.title', 'Interface')

Affected: SettingsDrawer, HeaderInterfaceSelector, InterfaceSection,
ModeSection, ReflectorSection, RFC2544Section, RFC2889Section,
RFC6349Section, Y1564Section, Y1731Section, MEFSection,
TrafficGenSection, TSNSection.

(2) Missing keys added to locale JSON (24 keys + ES translations):

common.json:
- accessibility.{closeSettings, openHistory, refreshInterfaces,
  selectProfile}
- interface.{networkInterfaces, noInterfaces, select}
- profile.{current, manage, noProfiles, select}
- tooltips.header.{refresh, history, help, settings, logout}
- status.{clickToReconnect, tapToReconnect, tapToReconnectHint}

settings.json:
- viewModuleHint, viewStandardHint
- tests.{rfc2544, rfc2889, rfc6349, y1564, y1731, mef, trafficgen,
  tsn}.title (8 test category headings)

setup.json:
- buttons.copyTooltip

ES translations follow I18N_TRANSLATION_MEMORY.md (formal usted,
sentence case, glossary terms preserved verbatim — Reflector, MEF,
RFC numbers, Y.1564 etc. stay English).

Validation: tsc clean; biome clean; vitest 136 passed; check-keys
strict mode now passes (was 48 errors, now 0); validator strict
still fails on the pre-existing 355 fallback-pattern check (separate
cleanup) and i18next 26.2 → 26.3 version bump (PR #317).

Drop the --ratchet flag from .github/workflows/ci.yml's
check_key_usage invocation in a separate PR once the related
fallback-pattern cleanup also lands.
@krisarmstrong
krisarmstrong enabled auto-merge (squash) May 27, 2026 14:45
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions

Copy link
Copy Markdown
Contributor

License Compliance Report

All dependencies pass license compliance checks

Go Dependencies

  • Unknown: 31 package(s)
  • MIT: 26 package(s)
  • BSD-3-Clause: 16 package(s)
  • Apache-2.0: 11 package(s)
  • BSD-2-Clause: 1 package(s)

npm Dependencies

See full report in workflow artifacts

Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0
Forbidden: GPL, AGPL, SSPL (strong copyleft)

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