Skip to content

docs(site): add i18n concept, guides, and API reference#1600

Draft
sampotts wants to merge 8 commits into
feat/i18n-sandboxfrom
docs/i18n
Draft

docs(site): add i18n concept, guides, and API reference#1600
sampotts wants to merge 8 commits into
feat/i18n-sandboxfrom
docs/i18n

Conversation

@sampotts

@sampotts sampotts commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #1373

Summary

Adds site documentation for the Video.js 10 i18n system: concept page, how-to guides, API/util reference pages, and sidebar wiring. Stacks on the i18n implementation branch (feat/i18n-sandbox).

Changes

  • Concept page covering opaque keys, registry, providers, BCP 47 fallback, and merge priority
  • How-to guides: register locale, override keys, switch locale (including registerI18n pre-cache patterns), SSR, and contributor built-in locale workflow
  • Reference pages for registry APIs, I18nProvider, hooks, HTML elements, createI18n, and core types (Locale, Translations, Translator, etc.)
  • I18nProvider listed under Components (alongside Player.Provider); hooks and factories stay under Hooks & Utilities
  • api-docs-builder entry points and JSDoc on core/react i18n exports for generated util reference tables
Stack info

Docs PR — targets feat/i18n-sandbox (#1593). Merge after the i18n implementation stack lands, or merge into the stack before the sandbox PR if preferred.

Testing

pnpm -F site api-docs
pnpm -F site build

Verify pages under Concepts → Internationalization, How to → i18n guides, and Features / Components / Hooks reference sections.

Made with Cursor


Note

Low Risk
Documentation and doc-generation/export surface only; no changes to i18n resolution, registry merge, or provider runtime logic.

Overview
This PR adds site documentation for Video.js 10 internationalization: a Concepts → Internationalization page, five how-to guides (register locale, overrides, runtime switch, SSR, contributor built-in locales), and reference pages for registry APIs, React I18nProvider/hooks, HTML media-i18n-provider / media-text, and core types.

Sidebar entries in docs.config.ts wire those pages under Concepts, How to, Components, Hooks & Utilities, Controllers & Mixins, and Features (including a Types subsection).

Supporting code (not new i18n behavior): @public JSDoc on core registry/translator exports; React default I18nProvider / hooks exported from create-i18n.tsx with a slimmer i18n/index.ts re-export; api-docs-builder scans @videojs/react/i18n and @videojs/core/i18n, fixes kebab slugs for I18n* names, and normalizes multi-part JSDoc descriptions for generated util reference JSON.

Reviewed by Cursor Bugbot for commit e2d03df. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Jul 3, 2026 4:15am

Request Review

@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 6f3b60d to 87ed51b Compare June 18, 2026 05:42
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 87ed51b to 2f16716 Compare June 18, 2026 05:50
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 2f16716 to d8d3bd8 Compare June 18, 2026 05:53
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from d8d3bd8 to 249f8e4 Compare June 18, 2026 05:57
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 249f8e4 to 99aff95 Compare June 18, 2026 06:03
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 99aff95 to 07c5ff8 Compare June 18, 2026 07:05
Comment thread site/scripts/api-docs-builder/src/util-handler.ts Outdated
Comment thread site/scripts/api-docs-builder/src/util-handler.ts
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 07c5ff8 to 14093e8 Compare June 18, 2026 10:09
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Initial Lazy
/video (default) 51.11 kB 51.99 kB
/video (default + hls) 190.50 kB 51.99 kB
/video (minimal) 51.17 kB 51.99 kB
/video (minimal + hls) 190.63 kB 51.99 kB
/audio (default) 44.38 kB 51.99 kB
/audio (minimal) 43.38 kB 51.99 kB
/background 7.27 kB 51.99 kB
Media (10)
Entry Initial
/media/background-video 1.14 kB
/media/container 1.71 kB
/media/dash-video 214.70 kB
/media/hlsjs-video 141.51 kB
/media/mux-audio 164.02 kB
/media/mux-video 163.99 kB
/media/native-hls-video 9.09 kB
/media/simple-hls-audio-only 17.15 kB
/media/simple-hls-video 18.70 kB
/media/vimeo-video 12.32 kB
Players (5)
Entry Initial Lazy
/video/player 11.26 kB 51.99 kB
/audio/player 8.45 kB 51.99 kB
/background/player 7.01 kB 51.99 kB
/live-video/player 10.64 kB 51.99 kB
/live-audio/player 8.46 kB 51.99 kB
Skins (30)
Entry Type Initial Lazy
/video/minimal-skin.css css 5.70 kB
/video/skin.css css 5.66 kB
/video/minimal-skin js 51.12 kB 51.99 kB
/video/minimal-skin.tailwind js 51.83 kB 51.99 kB
/video/skin js 51.10 kB 51.99 kB
/video/skin.tailwind js 51.97 kB 51.99 kB
/audio/minimal-skin.css css 3.97 kB
/audio/skin.css css 3.87 kB
/audio/minimal-skin js 43.40 kB 51.99 kB
/audio/minimal-skin.tailwind js 43.94 kB 51.99 kB
/audio/skin js 44.39 kB 51.99 kB
/audio/skin.tailwind js 44.90 kB 51.99 kB
/background/skin.css css 133 B
/background/skin js 1.14 kB
/live-video/minimal-skin.css css 5.70 kB
/live-video/skin.css css 5.66 kB
/live-video/minimal-skin js 49.87 kB 51.99 kB
/live-video/minimal-skin.tailwind js 50.37 kB 51.99 kB
/live-video/skin js 49.65 kB 51.99 kB
/live-video/skin.tailwind js 50.27 kB 51.99 kB
/live-audio/minimal-skin.css css 3.97 kB
/live-audio/skin.css css 3.87 kB
/live-audio/minimal-skin js 35.74 kB 51.99 kB
/live-audio/minimal-skin.tailwind js 35.23 kB 51.99 kB
/live-audio/skin js 36.86 kB 51.99 kB
/live-audio/skin.tailwind js 36.39 kB 51.99 kB
/global.css css 183 B
/shared.css css 153 B
/tailwind.css css 161 B
/skin-element js 5.28 kB 51.99 kB
UI Components (39)
Entry Initial
/ui/airplay-button 2.55 kB
/ui/alert-dialog 2.88 kB
/ui/alert-dialog-close 2.39 kB
/ui/alert-dialog-description 2.36 kB
/ui/alert-dialog-title 2.36 kB
/ui/audio-track-radio-group 3.14 kB
/ui/buffering-indicator 2.60 kB
/ui/captions-button 2.63 kB
/ui/captions-radio-group 3.10 kB
/ui/cast-button 2.55 kB
/ui/compounds 3.04 kB
/ui/controls 2.88 kB
/ui/error-dialog 2.91 kB
/ui/fullscreen-button 2.57 kB
/ui/hotkey 2.47 kB
/ui/menu 2.92 kB
/ui/mute-button 2.56 kB
/ui/pip-button 2.58 kB
/ui/play-button 2.58 kB
/ui/playback-rate-button 2.67 kB
/ui/playback-rate-radio-group 2.95 kB
/ui/popover 3.13 kB
/ui/poster 2.44 kB
/ui/quality-radio-group 3.11 kB
/ui/seek-button 2.56 kB
/ui/seek-indicator 2.78 kB
/ui/seek-indicator-value 442 B
/ui/slider 2.91 kB
/ui/status-announcer 2.48 kB
/ui/status-indicator 2.61 kB
/ui/status-indicator-value 402 B
/ui/thumbnail 2.57 kB
/ui/time 2.90 kB
/ui/time-slider 2.94 kB
/ui/tooltip 2.92 kB
/ui/volume-indicator 2.57 kB
/ui/volume-indicator-fill 435 B
/ui/volume-indicator-value 408 B
/ui/volume-slider 2.91 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Initial Lazy
/video (default) 42.92 kB 51.99 kB
/video (default + hls) 180.96 kB 51.99 kB
/video (minimal) 43.41 kB 51.99 kB
/video (minimal + hls) 181.43 kB 51.99 kB
/audio (default) 36.21 kB 51.99 kB
/audio (minimal) 36.21 kB 51.99 kB
/background 579 B
Media (9)
Entry Initial
/media/background-video 403 B
/media/dash-video 212.96 kB
/media/hlsjs-video 139.77 kB
/media/mux-audio 162.32 kB
/media/mux-video 162.31 kB
/media/native-hls-video 7.28 kB
/media/simple-hls-audio-only 15.40 kB
/media/simple-hls-video 16.96 kB
/media/vimeo-video 10.45 kB
Skins (27)
Entry Type Initial Lazy
/tailwind.css css 161 B
/video/minimal-skin.css css 5.55 kB
/video/skin.css css 5.52 kB
/video/minimal-skin js 43.28 kB 51.99 kB
/video/minimal-skin.tailwind js 49.27 kB 51.99 kB
/video/skin js 42.88 kB 51.99 kB
/video/skin.tailwind js 48.86 kB 51.99 kB
/audio/minimal-skin.css css 3.79 kB
/audio/skin.css css 3.68 kB
/audio/minimal-skin js 36.14 kB 51.99 kB
/audio/minimal-skin.tailwind js 38.30 kB 51.99 kB
/audio/skin js 36.09 kB 51.99 kB
/audio/skin.tailwind js 40.28 kB 51.99 kB
/background/skin.css css 90 B
/background/skin js 272 B
/live-video/minimal-skin.css css 5.55 kB
/live-video/skin.css css 5.52 kB
/live-video/minimal-skin js 37.86 kB 51.99 kB
/live-video/minimal-skin.tailwind js 43.79 kB 51.99 kB
/live-video/skin js 37.87 kB 51.99 kB
/live-video/skin.tailwind js 43.87 kB 51.99 kB
/live-audio/minimal-skin.css css 3.79 kB
/live-audio/skin.css css 3.68 kB
/live-audio/minimal-skin js 26.65 kB 51.99 kB
/live-audio/minimal-skin.tailwind js 29.81 kB 51.99 kB
/live-audio/skin js 26.73 kB 51.99 kB
/live-audio/skin.tailwind js 29.84 kB 51.99 kB
UI Components (33)
Entry Initial
/ui/airplay-button 2.45 kB
/ui/alert-dialog 2.53 kB
/ui/audio-track 2.29 kB
/ui/buffering-indicator 2.39 kB
/ui/captions-button 2.42 kB
/ui/captions-radio-group 2.32 kB
/ui/cast-button 2.41 kB
/ui/controls 2.43 kB
/ui/error-dialog 2.47 kB
/ui/fullscreen-button 2.45 kB
/ui/gesture 2.23 kB
/ui/hotkey 2.23 kB
/ui/live-button 2.36 kB
/ui/menu 2.62 kB
/ui/mute-button 2.39 kB
/ui/pip-button 2.43 kB
/ui/play-button 2.46 kB
/ui/playback-rate 2.39 kB
/ui/playback-rate-button 2.47 kB
/ui/popover 2.96 kB
/ui/poster 2.40 kB
/ui/quality 2.30 kB
/ui/seek-button 2.42 kB
/ui/seek-indicator 2.62 kB
/ui/slider 2.57 kB
/ui/status-announcer 2.29 kB
/ui/status-indicator 2.33 kB
/ui/thumbnail 2.32 kB
/ui/time 2.24 kB
/ui/time-slider 2.50 kB
/ui/tooltip 2.97 kB
/ui/volume-indicator 2.33 kB
/ui/volume-slider 2.48 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (69)
Entry Initial Lazy
. 10.81 kB
/dom 17.56 kB
/dom/media/custom-media-element 2.09 kB
/dom/media/dash 208.96 kB
/dom/media/google-cast 4.03 kB
/dom/media/hls-js 135.88 kB
/dom/media/media-host 1.25 kB
/dom/media/media-played-ranges 576 B
/dom/media/mux 151.26 kB
/dom/media/native-hls 3.09 kB
/dom/media/simple-hls 16.51 kB
/dom/media/simple-hls-audio-only 14.92 kB
/dom/media/vimeo 9.86 kB
/media/predicate 563 B
/i18n 2.72 kB 51.99 kB
/i18n/runtime 1.32 kB
/i18n/locales/all 30.62 kB
/i18n/locales/ar 1.15 kB
/i18n/locales/az 1.04 kB
/i18n/locales/bg 1.21 kB
/i18n/locales/bn 1.23 kB
/i18n/locales/bs 981 B
/i18n/locales/ca 1.01 kB
/i18n/locales/cs 1019 B
/i18n/locales/cy 987 B
/i18n/locales/da 965 B
/i18n/locales/de 1.04 kB
/i18n/locales/el 1.39 kB
/i18n/locales/en 763 B
/i18n/locales/es 970 B
/i18n/locales/et 1.00 kB
/i18n/locales/eu 979 B
/i18n/locales/fa 1.15 kB
/i18n/locales/fi 1007 B
/i18n/locales/fr 1.01 kB
/i18n/locales/gd 1.05 kB
/i18n/locales/gl 965 B
/i18n/locales/he 1.07 kB
/i18n/locales/hi 1.24 kB
/i18n/locales/hr 1000 B
/i18n/locales/hu 1.04 kB
/i18n/locales/it 1004 B
/i18n/locales/ja 1.13 kB
/i18n/locales/ko 1.08 kB
/i18n/locales/lv 1.02 kB
/i18n/locales/mr 1.23 kB
/i18n/locales/nb 954 B
/i18n/locales/ne 1.23 kB
/i18n/locales/nl 976 B
/i18n/locales/nn 951 B
/i18n/locales/oc 1.02 kB
/i18n/locales/pl 1.07 kB
/i18n/locales/pt 981 B
/i18n/locales/pt-BR 981 B
/i18n/locales/pt-PT 954 B
/i18n/locales/ro 1.00 kB
/i18n/locales/ru 1.28 kB
/i18n/locales/sk 1.05 kB
/i18n/locales/sl 1008 B
/i18n/locales/sr 976 B
/i18n/locales/sv 978 B
/i18n/locales/te 1.26 kB
/i18n/locales/th 1.23 kB
/i18n/locales/tr 1.03 kB
/i18n/locales/uk 1.30 kB
/i18n/locales/vi 1.04 kB
/i18n/locales/zh 973 B
/i18n/locales/zh-CN 973 B
/i18n/locales/zh-TW 980 B
🏷️ @videojs/element — no changes
Entries (2)
Entry Initial
. 996 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Initial
. 1.39 kB
/html 696 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Initial
/array 104 B
/dom 2.71 kB
/events 319 B
/function 327 B
/object 275 B
/predicate 265 B
/string 231 B
/style 190 B
/time 792 B
/number 158 B
📦 @videojs/spf — no changes
Entries (4)
Entry Initial
. 4.45 kB
/dom 6.33 kB
/hls 15.37 kB
/background-video 12.89 kB

ℹ️ How to interpret

JS sizes are initial static graph totals (minified + brotli). Lazy dynamic chunks are shown separately when present.

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current initial sizes.

@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 5786d7b to bbbb82f Compare June 30, 2026 08:26
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from bbbb82f to a900982 Compare June 30, 2026 09:02
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from a900982 to 342acb4 Compare July 1, 2026 02:44
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 342acb4 to 762012a Compare July 1, 2026 02:56
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 762012a to 1704f24 Compare July 1, 2026 04:43
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from 1704f24 to f3a22ea Compare July 1, 2026 04:49
@sampotts sampotts force-pushed the feat/i18n-sandbox branch from f3a22ea to 756f925 Compare July 2, 2026 04:37
sampotts and others added 8 commits July 3, 2026 13:53
Documents opaque keys, registry APIs, React/HTML providers, and locale
workflows for #1373. Extends api-docs-builder discovery for core/react
i18n exports and adds matching reference MDX pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add Locale, BuiltInLocale, TranslationParams, Translations, and Translator
reference pages plus createTranslator. Cross-link types from concept and
guides; fix React examples and register-locale satisfies pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document registerI18n pre-caching at bootstrap and before switch,
compare with I18nProvider translations prop, and note global merge behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove frameworkTitle overrides so the i18n concept page matches other
concept pages with one title across HTML and React modes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Group I18nProvider with Player.Provider and Player.Container as
infrastructure providers; keep createI18n and hooks under Hooks & Utilities.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants