fix(i18n): translate the home Recent Requests panel and topology legend - #12551
Open
pacocartones wants to merge 2 commits into
Open
fix(i18n): translate the home Recent Requests panel and topology legend#12551pacocartones wants to merge 2 commits into
pacocartones wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/app/(dashboard)/home/HomeRecentRequests.tsx) already reads every label throughuseTranslations("home"), but the five keys it uses (home.recentRequests,recentRequestsEmpty,recentRequestsModel,recentRequestsTokens,recentRequestsWhen) shipped in feat(home): add Recent Requests panel + excludeTests allowlist fix #10900 as verbatim English copies in 39 of the 41 non-English catalogs (only pt-BR and vi were translated). A verbatim copy is invisible to every i18n gate:check-ui-keys-coveragecounts it as covered,sync-ui-keysonly backfills absent keys, andcheck-ui-value-driftonly sees English values that change. So the panel rendered "RECENT REQUESTS / Model / In / Out / When" in es, fr, de, it, ja and every other locale.src/app/(dashboard)/dashboard/HomeProviderTopologySection.tsx) borrowed three labels from unrelated namespaces:common.active,settings.recent(the memory-retrieval "Chronological window" toggle, itself an English copy in 33 locales) andanalytics.modelStatusError(lower-case "error" in es). The result in Spanish was "Activo · Recent · error" under a Spanish title.home.topologyLegendActive/topologyLegendRecent/topologyLegendError, next to thehome.activeErrorsubtitle they sit under, with consistent capitalisation per locale. The recent-requests keys get real translations in es, pt, fr, de and it (pt-BR and vi were already correct); the legend keys are translated in es, pt, pt-BR, fr, de, it and vi. Every other locale gets the repo's__MISSING__:<english>marker (the form feat(admin): localize the anomalies page and add it to the sidebar #12401 used for new keys) instead of a silent English copy — the runtime still falls back to English there, but the keys are now visible toi18n:sync-ui --translate-markers. Where a locale already had a translatedcommon.active/settings.recent/analytics.modelStatusError, that translation is reused for the legend rather than a marker (54 reused, 48 markers across the 34 locales I did not translate by hand). No English value changed, so the value-drift gate is unaffected.FirstRunReadinessCardhome.readiness*keys (10) plushome.stepError,home.requestsShort,home.aliasLabelare also English copies in es and most locales;analytics.modelStatusErroris still lower-case "error" in es on the analytics page;settings.recentremains an English copy in 33 locales on the memory settings tab.Before / after (es-ES)
Before:
After:
Related Issues
gh issue list --search "recent requests i18n"/--search topologyreturn unrelated backlog items).Validation
tests/unit/i18n-home-recent-requests-topology-legend.test.ts5/5; neighbouring i18n suites (i18n-vi-completeness,i18n-placeholder-parity,i18n-ui-value-drift,i18n-pt-br,i18n-locale-surfaces-parity,translator-friendly-i18n-keys,i18n-hardcoded-ui-regressions,i18n-translation-ratio-gate,i18n-config) 250/250;npm run i18n:check-ui-coveragePASS (41 locales ≥ 80%);BASE_REF=origin/release/v3.8.51 npm run i18n:check-value-driftPASS;npm run i18n:check-ratioOK (41 locales within baseline +0.5);npm run check:changelog-integrityOK;node scripts/check/check-complexity-ratchets.mjs --base-ref origin/release/v3.8.51OK (0 violations)npm run lint— not run repository-wide; eslint and prettier were run on the two touched TS files and the catalogs, both cleanrelease/v3.8.51; focused checks rerun afterwardRed on the base: the new test file fails 4 of 5 cases against
release/v3.8.51(keys missing, English copies present, legend borrowingsettings.recent); green with this change (5/5).Tests Added Or Updated
tests/unit/i18n-home-recent-requests-topology-legend.test.ts(new, 5 cases): the eight home-widget keys exist and are non-empty in all 42 catalogs; es/pt/pt-BR/fr/de/it/vi hold real translations (no__MISSING__marker, not the English value, withes.home.topologyLegendError = "Error"allow-listed as a genuine cognate); no locale keeps a silent English copy of the five recent-requests keys (translated or marked);HomeProviderTopologySection.tsxreads the legend fromhome.topologyLegend*and no longer fromsettings.recent/analytics.modelStatusError; the three legend labels share capitalisation within each maintained locale.Coverage Notes
src/app/(dashboard)/dashboard/HomeProviderTopologySection.tsx: the only production change is threet()calls and the removal of three unuseduseTranslationshooks; the new static test pins the key names it must use. No touched file lost coverage.src/i18n/messages/*.json: catalog data, covered by the new test and the existing i18n gates listed above.Reviewer Notes
__MISSING__:markers replace values that were already English, so nothing regresses visually in those locales:deepMergeFallback(src/i18n/request.ts) renders the English fallback exactly as before. The change makes the debt visible to the translation pipeline instead of hiding it as "covered".nl.home.recentRequestsModelbecomes__MISSING__:Modelalthough Dutch "Model" is correct; I left it to the pipeline rather than hand-pick cognates outside the languages I can vouch for. The same applies to any other coincidental cognate among the marked locales.showProviderTopologyOnHomeenabled, then confirm the panel header, the three column headers, the empty state and the legend all read in Spanish, and that the legend casing matches the "Activo · Reciente · Error" row.