Docs/improve lang import and set#1287
Conversation
|
@ronalduQualabs is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1287 +/- ##
==========================================
- Coverage 78.55% 73.55% -5.00%
==========================================
Files 59 56 -3
Lines 11080 13884 +2804
Branches 0 783 +783
==========================================
+ Hits 8704 10213 +1509
- Misses 2376 3638 +1262
- Partials 0 33 +33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a8620c4. Configure here.
| document.getElementById('set-lang-info').innerHTML = | ||
| `Language set: <strong>[${active}]</strong> - (${setDisplayName})`; | ||
| document.documentElement.lang = active; | ||
| } |
There was a problem hiding this comment.
Dropdown selection not synced with resolved language
Low Severity
The language selection dropdown defaults to "English" on load due to a hardcoded selected attribute. While updateSetLangInfo correctly identifies and displays the resolved language (e.g., from browser settings), it doesn't update the dropdown's value, leading to a mismatch between the displayed language and the dropdown's selection.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a8620c4. Configure here.
|
|
||
| <media-controller | ||
| id="mc" | ||
| lang='en' |
There was a problem hiding this comment.
Switching to English fails for non-English browsers
Medium Severity
Removing the lang='en' attribute from <media-controller> creates a state desync. The i18n module sets currentLang to navigator.language, but the store's mediaLang defaults to 'en' (via mediaLang ?? 'en'). When a non-English browser user selects English from the dropdown, setLanguage('en') updates currentLang, but the store's derived mediaLang remains 'en' — no state change is detected, so components never re-render and the UI stays in the previous language.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a8620c4. Configure here.


Improve docs for adding/setting lang support and include German option to examples.
Note
Medium Risk
Mostly docs/example updates, but it adds new public surface (
MediaController.resolvedLang) and tweaks i18n resolution behavior, which could affect consumers relying onlang/translation fallback.Overview
Improves internationalization guidance by documenting supported languages (including
de), clarifying that language modules must load before Media Chrome when using HTML, and adding explicit examples for overriding language via the<media-controller lang>attribute or JS.Updates the vanilla
internationalization.htmlexample to include German, reorder script loading so translations register before component init, and replace per-language buttons with a language dropdown plus display of detected vs. active language.Adds
getResolvedLanguage()inutils/i18n.tsand exposes it as a newmedia-controllerpropertyresolvedLangto report the effective language after fallback (e.g., base tag oren).Reviewed by Cursor Bugbot for commit a8620c4. Bugbot is set up for automated code reviews on this repo. Configure here.