MSD: Load locale data for the interim omnibar#109882
Closed
StevenDufresne wants to merge 2 commits intorefactor/interim-omnibar-hooks-data-flowfrom
Closed
MSD: Load locale data for the interim omnibar#109882StevenDufresne wants to merge 2 commits intorefactor/interim-omnibar-hooks-data-flowfrom
StevenDufresne wants to merge 2 commits intorefactor/interim-omnibar-hooks-data-flowfrom
Conversation
The interim omnibar hydrates independently from the main dashboard `Layout`, which provides the `I18nProvider`, so it was always rendering in English. Fetch and apply the user's locale data via a dedicated query so the Masterbar re-renders with translated strings after the locale JSON arrives. Ports the change from #109762 onto the hooks-based data flow. Fixes: DOTMSD-1199 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Jetpack Cloud Live (direct link)
Automattic for Agencies Live (direct link)
Dashboard Live (dotcom) (direct link)
|
Contributor
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Replace the `useQuery`-for-side-effect pattern with a plain `useEffect` that fetches the locale JSON and applies it to `defaultI18n`. The hook now also gates the "full" omnibar render on locale readiness so bootstrapped non-English users see the SSR-matching placeholder until their translations are applied — no flash of English content with real user/site data. For English bootstrapped users, `localeVersion` starts at 1 so the gate opens as soon as hydration commits (no extra frame). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Part of DOTMSD-1199
Stacked on #109881
Proposed Changes
useInterimOmnibarData, so the Masterbar re-renders with translated strings after the locale JSON arrives.Why are these changes being made?
The interim omnibar hydrates independently from the main dashboard
Layout(which provides theI18nProvider), so without this it always renders in English — regardless of the user's language setting.Testing Instructions
dashboard/omnibarfeature flag and hard-reload a Dashboard page.Note: expect a brief English frame before the locale JSON resolves — the refactor uses incremental React renders rather than blocking on all data before a single render.
Pre-merge Checklist