TranslationParams
Typed contract for translation phrases and their placeholder arguments
TranslationParams maps every current English translation phrase to its argument shape. Phrases with never accept only t('Phrase'). Phrases with an object accept t('Phrase {value}', { ... }) with typed placeholder names.
See Translation phrases for the complete key catalog and where each phrase appears.
Import
import type { TranslationParams } from '@videojs/html/i18n';
import type { TranslationParams } from '@videojs/react/i18n';
Definition
type TranslationParams = {
Play: never;
Pause: never;
'Seek forward {seconds} seconds': { seconds: number | string };
'{duration} remaining': { duration: string };
// ...
};
English defaults and the full phrase list live in packages/core/src/core/i18n/locales/en.ts. The authoritative TypeScript map is packages/core/src/core/i18n/types.ts.
Parametric phrases
| Phrase | Placeholders |
|---|---|
Seek forward {seconds} seconds
|
{seconds}
|
Seek backward {seconds} seconds
|
{seconds}
|
Playback rate {rate}
|
{rate}
|
{current} of {duration}
|
{current}, {duration}
|
{duration} remaining
|
{duration}
|
{percent}, muted
|
{percent}
|
Volume {value}
|
{value}
|
Auto ({label})
|
{label}
|
All other phrases are plain strings with no parameters.
Usage
const t: Translator = createTranslator(translations, 'es');
t('Play');
t('Seek forward {seconds} seconds', { seconds: 10 });
t('{duration} remaining', { duration: '1 minute' });
TypeScript rejects missing placeholders when defining Translations overlays.