Feat/profile switch language#1172
Conversation
ghanse
left a comment
There was a problem hiding this comment.
Solid i18n landing — clean key parity across en/es/it/pt-BR, JSON validates, and every route I spot-checked routes user-facing strings through t(). Two functional gotchas to address before merge: (1) <html lang> is never synchronized when LanguageDetector picks a non-English locale on first load (a11y / screen-reader regression), and (2) rulesSingleTable.summary / duplicateChecksExist_* interpolate a hard-coded English "s" via {{tablesPlural}}/{{checksPlural}}/{{rulesPlural}} placeholders, which the non-English translators correctly dropped — producing a placeholder-count divergence and defeating proper pluralization.
Smaller items addressed inline: t in AuthGuard's effect deps, all four locales bundled eagerly (~262 KB raw), ~50 unused common.* keys. Recommend adding a make app-check script that asserts placeholder-set parity across locales to prevent this class of bug going forward.
Two follow-ups on pre-existing code that this PR makes newly relevant (not anchorable to the diff, hence here in the summary):
app/src/databricks_labs_dqx_app/ui/routes/_sidebar/config.tsx~ lines 60 and 66 —Intl.DateTimeFormat("en-US", …)is hard-coded for two timezone-label formatters. Every user (including pt-BR / es / it) sees timezone short names (PST,CET) and offset formatting in English. Passundefined(browser default) ori18n.languageso this matches the rest of the UI.format-utils.tsalready usesundefined, so this is the only outlier.app/src/databricks_labs_dqx_app/ui/routes/_sidebar/rules.drafts.tsx:7(alsorules.active.tsx:54,148,runs-history.tsx:243) — the synthetic catalog label"Cross-table rules"is used both as an internal filter id and rendered to the user. With i18n in this PR, it should be translated at render time while keeping the internal id stable, e.g.cat === CROSS_TABLE_CATALOG ? t("common.crossTableRules") : cat. Most visible untranslated remnant.
Co-authored-by: Greg Hansen <163584195+ghanse@users.noreply.github.com>
|
|
|
Hi @ghanse . Thanks for your review. I've tried to apply all the suggestions. Please let me know if they are OK or if there are any missing issues. I really appreciate your support! |
I think this is fine. We can have follow up PRs to add more languages |
mwojtyczka
left a comment
There was a problem hiding this comment.
Re-reviewed after the latest round — thanks for the thorough fixes. Verified and resolved 13 of the 14 threads (a11y <html lang> sync, AuthGuard t ref, lazy-loading, useId/aria-label, locale-switch .catch, the blank-page .catch, the common.* cleanup, the Italian discovery translation, and the CLAUDE.md i18n section all check out; locale key sets are now at full parity — 1142 keys in each of the 4 files). Left the CI placeholder-parity-check thread open since that's a pending follow-up rather than a code fix.
One residual instance of the same plural anti-pattern from the (now-fixed) rules.single-table.tsx thread — flagged inline.
|
resolved the conflicts |
Replace the {{tablesPlural}}/{{checksPlural}} placeholders in
rulesActive.tablesAndChecks and checksAcrossTables with native i18next
_one/_other fragment keys (tablesCount/checksCount) composed via nested
t() calls, matching the existing rulesSingleTable.summary pattern. This
fixes broken plurals in es/it/pt-BR (e.g. 'verificacións' -> proper
'verificaciones'). Keys added to all four locales; parity preserved.
Co-authored-by: Isaac
New pytest (runs under `make app-test`, no JS toolchain needed) asserts,
with en.json as source of truth, that every locale has:
- the same key set (catches keys that silently fall back to English), and
- the same {{placeholder}} set per key (catches missing/extra interpolation
that triggers i18next missingInterpolation),
and that no locale uses a hard-coded {{*Plural}} placeholder (use native
_one/_other + {{count}} instead) — the anti-pattern fixed in 9830447, which
placeholder-set parity alone would not catch since all locales shared it.
Co-authored-by: Isaac
|
Thanks for the reviews, guys. Please let me know if you need anything else from my side at this time. |
Fixes TS6133 'formatLabel is declared but its value is never read' that broke the Build and Check App TypeScript compilation in CI. Co-authored-by: Isaac

Changes
Linked issues
#1171
Tests
Documentation and Demos
Adds in-app language switching to DQX Studio, surfaced from the user's Profile page. The studio now ships with four locales (English, Portuguese-BR, Italian, Spanish) and persists the user's choice per-browser without touching server-side state.
Frontend — i18n infrastructure
Frontend — UI
Docs
Notes for reviewers
Images