feat(sandbox): add i18n demos and e2e coverage#1593
Open
sampotts wants to merge 38 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced May 25, 2026
3e339d1 to
9ded52e
Compare
9ded52e to
f0925b2
Compare
f0925b2 to
b7fead7
Compare
b7fead7 to
9f2c8ce
Compare
9f2c8ce to
bf657c7
Compare
bf657c7 to
304599e
Compare
304599e to
5221ff6
Compare
5221ff6 to
e210fe0
Compare
Use formatRemaining with the parametric timeRemainingPhrase template instead of the removed remainingTimeSuffix key. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds integration coverage that play button aria-label updates when document.documentElement.lang changes and the i18n provider has no explicit lang attribute. Co-authored-by: Cursor <cursoragent@cursor.com>
Use mergeLocaleOverlays loadedTags instead of merged overlay so English-only lazy merges no longer block browser translation fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
Add createI18n with ambient lang inheritance, browser translation fallback, default loadLocale, and translated aria labels across React player UI. Co-authored-by: Cursor <cursoragent@cursor.com>
Wrap the player Provider with I18nProvider so preset skins inherit locale and lazy locale loading, and restore English ARIA expectations in tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Let outer I18nProvider (sandbox locale) win over player chrome, and skip nested default providers so locale props are not shadowed. Co-authored-by: Cursor <cursoragent@cursor.com>
Pass langRootRef from Container for ambient lang resolution, fall back to documentElement before mount, and inherit ancestor locale when a nested provider only supplies translation overrides. Co-authored-by: Cursor <cursoragent@cursor.com>
Only pass locale to I18nProviderRoot when a value is resolved so nested providers do not assign undefined under exactOptionalPropertyTypes. Co-authored-by: Cursor <cursoragent@cursor.com>
Re-check lazy-load sequence after getBrowserTranslations resolves so a superseded locale cannot register browser translations globally. Co-authored-by: Cursor <cursoragent@cursor.com>
Use formatRemaining with the parametric timeRemainingPhrase template instead of the removed remainingTimeSuffix key. Co-authored-by: Cursor <cursoragent@cursor.com>
Container's langRootRef no longer forces a nested provider that shadows an ancestor locale or translations prop. Co-authored-by: Cursor <cursoragent@cursor.com>
Track whether a provider locale came from an explicit prop so Container's langRootRef still resolves player shell lang when a test or app wrapper supplies an ambient ancestor provider. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds regression tests for document.documentElement.lang updates on I18nProvider with and without langRootRef. Co-authored-by: Cursor <cursoragent@cursor.com>
Use mergeLocaleOverlays loadedTags instead of merged overlay so English-only lazy merges no longer block browser translation fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
Wire locale switching across HTML, React, and CDN sandbox presets with shared locale helpers, browser-only locale prefetch, and i18n e2e tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep postMessage-driven toggles from forcing a cache-busted iframe reload when autoplay, muted, or other shell controls change. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the templates/cdn index override that produced an invalid relative chunk path under Vite 8; setup already mirrors templates into src/cdn. Co-authored-by: Cursor <cursoragent@cursor.com>
Serialize overlapping HTML/CDN locale updates, validate locale only in shared listeners, and remove the vite e2e spec that referenced a missing page. Co-authored-by: Cursor <cursoragent@cursor.com>
Track the previous locale so the CDN preview only cache-busts when locale actually changes, not on the initial effect run. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the readyLocale gate so locale switches and browser prefetch failures no longer unmount the player preview. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Update preview iframe src when locale changes so embedded reloads keep the selected language, not just the initial URL param. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the misplaced "Media utilities" comment above the i18n re-exports. Co-authored-by: Cursor <cursoragent@cursor.com>
…locale Stop pinning lang on media-i18n-provider and I18nProvider locale props so document.documentElement.lang and the locale picker both drive i18n through the ambient observer as documented. Co-authored-by: Cursor <cursoragent@cursor.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.
Refs #222
Closes #1594
Summary
Adds locale switching to all sandbox presets (HTML, React, CDN) with shared helpers and e2e tests verifying translated control labels.
Changes
locale=esStack info
PR 5 of 5 — stacks on React i18n PR. Final PR in the i18n stack.
Testing
Note
Low Risk
Changes are confined to the sandbox app, dev Vite plugins, and e2e tests—not production player bundles or auth.
Overview
Adds locale switching across the sandbox shell and every HTML, React, and CDN preset, plus Playwright coverage that Spanish (
locale=es) shows Reproducir on the play control (direct tab and shell iframe).The shell gains a Language control in Player settings, keeps
localein the URL, and broadcastslocale-changeviapostMessage(CDN preview reloads the iframe when locale changes). Shared helpers load built-in packs or Chrome Translator–only tags, with separate paths for source@videojs/html/i18nvs CDN@videojs/html/cdn/i18n(generated locale loaders,media-i18n-providerwrapping, and a Vite plugin that pins a single CDN registry and blocks mixing source i18n in the CDN sandbox).Template mirroring now overwrites
src/when it diverges fromtemplates/(documented in README); setup also regenerates CDN locale loader maps.Reviewed by Cursor Bugbot for commit 879d941. Bugbot is set up for automated code reviews on this repo. Configure here.