Skip to content

feat(i18n): extract shell navigation strings (batch 1)#1152

Open
JamieRuderman wants to merge 2 commits into
feature/i18nfrom
i18n/extract-shell
Open

feat(i18n): extract shell navigation strings (batch 1)#1152
JamieRuderman wants to merge 2 commits into
feature/i18nfrom
i18n/extract-shell

Conversation

@JamieRuderman

Copy link
Copy Markdown
Member

Summary

First string-extraction batch (Phase 4): the shell navigation chrome — the sidebar nav, the avatar/account menu, and the mobile bottom nav. These labels appear on every screen, so they're the highest-visibility surface to internationalize first and the best proof of the pattern at scale.

Targets feature/i18n, not main — this stacks on the i18n foundation and is meant to be reviewed on its own.

Changes

  • SidebarNav.tsx, AvatarMenu.tsx, BottomMenu.tsx — all hardcoded labels, tooltips, and confirmation-dialog copy routed through t() under a new nav.* key group (31 keys). Shared labels (Connections/Devices/Networks) reuse the same keys across sidebar and bottom nav; the "Are you sure?" confirm titles reuse the existing common.areYouSure.
  • Interpolation, not concatenation — the two count tooltips use placeholders ({{connections}} Connections - {{active}} Connected), and the old (testUI ? '' : 'Enable ') + 'Test UI' string-building was split into two full-sentence keys (nav.testUI / nav.enableTestUI).
  • Translationsnav.* seeded in ja/de/es (machine-translated via Sonnet, flagged for professional review before production). Placeholder parity verified: {{connections}}/{{active}} preserved in all three locales.

Tooling fix (separate commit)

Found and fixed a bug in i18next-parser.config.js: the installed parser passes the inline t() default as a plain string in the callback's 4th arg, but the config read it as an object (value?.usageContext?.defaultValue), so English values always came out empty. Now English catalogs populate correctly from the inline defaults. (The earlier options.* values had survived only because the parser preserves pre-existing non-empty values.)

Verification

  • i18n:check passes — 4 locales × 3 namespaces, no missing keys, no empty English.
  • tsc --noEmit clean; production build passes.
  • Placeholder parity across en/ja/de/es confirmed programmatically (zero mismatches).

Untranslated strings elsewhere still fall back to English, so nothing regresses.

🤖 Generated with Claude Code

@JamieRuderman

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9dc277d6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +152 to +155
title: t('common.areYouSure', 'Are you sure?'),
children: t(
'nav.testUIConfirm',
'Enabling alpha features may be unstable. It is only intended for testing and development.'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Localize the confirmation action buttons

In any Japanese, German, or Spanish locale, opening this confirmation dialog—or the newly translated lock and quit dialogs—shows a translated title and body alongside English Cancel and Ok buttons. ListItemSetting always supplies onDeny, while frontend/src/components/Confirm.tsx:28,48-54 hard-codes those two labels, so the confirmation controls also need to use the active translations.

Useful? React with 👍 / 👎.

Comment on lines +86 to +87
connections: counts.connections.toLocaleString(),
active: counts.active.toLocaleString(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Format tooltip counts with the selected app locale

When the user overrides the app language to German or Spanish while the OS/browser remains English, counts of at least 1,000 are interpolated as strings such as 1,000 Verbindungen rather than using the selected language's number formatting. Calling toLocaleString() without an explicit locale uses the runtime default; these newly localized tooltip values should use the active app locale (available through the repository's getLocale() helper) or an i18next number formatter.

Useful? React with 👍 / 👎.

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