Skip to content

fix(clients): i18n follow-ups after the admin and dashboard slices - #1459

Merged
iammukeshm merged 1 commit into
mainfrom
fix/i18n-followups
Nov 3, 2026
Merged

iammukeshm merged 1 commit into
mainfrom
fix/i18n-followups

Conversation

@iammukeshm

Copy link
Copy Markdown
Member

These are the small items from the reviews of #1383 and #1384 that I said I'd pick up myself, plus one leftover from #1454.

Admin language switcher. It reads the profile, merges in the new locale and writes it back, but the write didn't send If-Match. So a name edit landing between the read and the write was silently overwritten. It now echoes the read's ETag (with a W/ prefix stripped, like the dashboard does), and on a 412 it runs the read-merge-write once more against the fresh profile. It also stops sending email, which the API dropped in #1454. To make that possible, admin's apiFetch gets the same onResponse hook the dashboard already has.

Dashboard container language. The dashboard reads defaultLanguage from config.json, but its container template never wrote it, so a containerized dashboard always started in en-US. The template and entrypoint now render it from FSH_DEFAULT_LANGUAGE (default en-US), the same as admin. deploy/docker passes it to both apps and documents it in .env.example, and Terraform now sets it on the dashboard site too, not just admin. The container CI job asserts the en-US default for both apps.

Deactivated-tenant fallback. Now that #1382 is in, the API always sends code: Multitenancy.TenantDeactivated. So the English-text match in api-client.ts, and the compatibility test that covered it, are gone.

Smaller fixes:

  • The upload hook (both apps) and the file preview effect (dashboard) were missing t in their dependency lists, so their error text stayed in the old language after a switch.
  • The unused theme-toggle.tsx in admin is removed.

Tested:

  • Both apps: lint 0 errors, tsc clean, build passes.
  • Admin: full Playwright suite passes.
  • I built the dashboard image and checked config.json with and without FSH_DEFAULT_LANGUAGE (pt-BR and en-US).
  • Two dashboard specs (tenant-deactivated.spec.ts:43 and :61) time out on my machine on a clean main too, while CI passes them, so I'm treating that as local.

Docs: fullstackhero/docs PR to follow (changelog entry).

- admin: the language switcher's profile save sends If-Match with the ETag
  of the read it merges from, retries once on 412, and no longer sends the
  email field the API dropped in #1454
- admin: apiFetch gains the onResponse hook the dashboard already has
- dashboard: the container renders defaultLanguage from FSH_DEFAULT_LANGUAGE
  like the admin does; compose passes it to both apps, Terraform sets it on
  the dashboard site, and the container CI job asserts the en-US default
- dashboard: drop the English-text fallback for the deactivated-tenant 403,
  now that the API always sends the Multitenancy.TenantDeactivated code
- both: add the missing t dependency to the upload hook and the file
  preview effect, so error text follows a language switch
- admin: remove the unused theme-toggle component
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