Skip to content
FrameworkStyle

createTranslator

Build a typed translator from a resolved translation map

createTranslator wraps a Translations map and returns a Translator. Providers call this internally after merging registry, lazy-loaded built-in packs, browser-translated fallback copy, and provider layers. Use it directly for custom UI outside built-in controls.

import { createTranslator, getI18nTranslations } from '@videojs/html/i18n';

const t = createTranslator(getI18nTranslations('fr'), 'fr');
t('Play');
t('Seek forward {seconds} seconds', { seconds: 5 });

API Reference

Parameters

Parameter Type Default Details
translations* Translations
locale* string & object | 'hr' | 'th' | 'tr' ...

Return Value

Translator