Locale
BCP 47 language tag type for i18n registry and provider APIs
Locale is the BCP 47 tag type used by registerI18n and provider APIs. Shipped tags autocomplete, and any other BCP 47 tag remains valid at runtime.
Import
import type { Locale } from '@videojs/html/i18n';
import type { Locale } from '@videojs/react/i18n';
Definition
type Locale = (typeof LOCALES)[number] | (string & {});
The (string & {}) pattern keeps custom tags ('xx', 'en-US') type-safe without losing autocomplete for shipped tags.
Provider use
Set a lang attribute on <media-i18n>; HTML providers do not have a locale attribute.
Pass a Locale to the locale prop on I18nProvider, or omit the prop to inherit lang.
Resolution
Providers and getI18nTranslations normalize tags and walk the parent chain (es-MX → es → en) via findLocaleKeys. See Internationalization for explicit and ambient resolution.