Skip to content

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

Open
sampotts wants to merge 6 commits into
feat/i18n-sandboxfrom
docs/i18n
Open

docs(site): add i18n concept, guides, and API reference#1600
sampotts wants to merge 6 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.

sampotts and others added 6 commits May 26, 2026 11:16
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>
@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 May 26, 2026 2:11am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant