getI18nTranslations
Read the merged translation map for a locale using BCP 47 parent-chain fallback
getI18nTranslations walks the BCP 47 lookup chain (es-MX → es → en) and merges registry layers into one map. Providers combine this map with lazy-loaded built-in packs and provider overrides. Call it directly when building custom UI outside built-in controls.
See Internationalization for merge order and fallback rules.
import { createTranslator, getI18nTranslations } from '@videojs/html/i18n';
const t = createTranslator(getI18nTranslations('pt-BR'), 'pt-BR');
t('buttons.play', { default: 'Play' });import { createTranslator, getI18nTranslations } from '@videojs/react/i18n';
const t = createTranslator(getI18nTranslations('pt-BR'), 'pt-BR');
t('buttons.play', { default: 'Play' });API Reference
Parameters
| Parameter | Type | Default | Details |
|---|---|---|---|
locale* | string & object | 'ar' | 'az' | 'bs' ... | — | |
| |||
Return Value
| Type | Details |
|---|---|
object & Record<string, string | unde... | |
| |