feat: multi-language support (pt/es) + internationalize remaining strings#376
feat: multi-language support (pt/es) + internationalize remaining strings#376opastorello wants to merge 2 commits into
Conversation
Make the whole UI follow NEXT_PUBLIC_APP_LOCALE and ship two extra
locales.
- Add messages/pt.json (Brazilian Portuguese) and messages/es.json
(Latin American Spanish); en/pt/es stay key-for-key identical.
- Internationalize ~250 previously hardcoded English strings across
~30 files (Notifications, AI agent, Signup, Forgot password, Join,
Flows header, interactive message builder, flow/automation template
galleries, theme picker, and scattered toasts/placeholders/aria).
- Fix pre-existing i18n leaks that showed raw keys even in English:
missing Settings.sections.quick-replies label; Overview role chip
using useTranslations('roles') instead of 'Settings.roles'; the
API-key scopesHint message embedding <code className> (next-intl
rich tags must be attribute-less).
- Fix Base UI Select triggers that rendered the raw enum value while
options were translated — 14 <SelectValue /> now show the selected
option's label.
- Internationalize API scope descriptions (Settings.apiKeys.scopeDesc).
Data files (flow/automation templates, themes) keep their English
name/description as seed fallback; galleries resolve display copy via
useTranslations keyed by each item's stable id.
typecheck, lint (0 errors), and production build pass.
|
Thanks @ivanmercedes! Good catch — updated the description to reference #173. This PR follows exactly that shape: English stays the default and fallback, and adding a locale is just one new |
|
Reviewed the branch locally — key parity (1683 keys × en/es/pt), ICU argument parity, 1. Missing
Harmless with a fixed global locale, but worth aligning for consistency (or intentionally leaving them all out). 2. Two pre-existing raw-key leaks not covered (optional, since this PR is cleaning up i18n leaks anyway):
next-intl ignores Neither blocks merge — otherwise LGTM. |
- members-tab, whatsapp-config, quick-replies-manager: include t in useCallback dependency arrays for consistency with the rest of the PR - add Automations.builder.delete and Contacts.detailView.tabs.tags to en/pt/es (next-intl ignores defaultValue/fallback options, so both rendered raw key paths)
|
Thanks for the thorough review @ArnasDon! Both points addressed in d539518:
|
Summary
Ship full multi-language support: add pt/es catalogs, internationalize the remaining hardcoded strings, and fix several i18n leaks (some visible even in English). The locale stays a single global value driven by
NEXT_PUBLIC_APP_LOCALE; English remains the default and fallback.What changed
messages/pt.json(pt-BR) andmessages/es.json(es-419), key-for-key identical toen.json(1683 leaf keys each; ICU/interpolation arguments preserved).Settings.sections.quick-replies; Overview role chip scope'roles'->'Settings.roles';scopesHint<code className>-> attribute-less<code>.<SelectValue />now render the selected option's translated label instead of the raw enum value.Settings.apiKeys.scopeDesc.*.Data files (flow/automation templates, themes) keep English name/description as seed fallback; galleries resolve display copy via
useTranslationskeyed by each item's stable id.Test plan
npm run typecheckclean.npm run lint— 0 errors.npm run buildsucceeds.useTranslationsscopes resolve to a catalog namespace (guards against raw-key leaks).NEXT_PUBLIC_APP_LOCALE=ptand spot-checked the converted screens.Related
Closes #375. Also resolves #173 (make UI text translatable without fork conflicts).