Skip to content

Translating the UI

Button labels, error messages and the Picture-in-Picture message are in English by default. Override them with VegaPlayer.i18n before the players are created, for example right after importing the module. Keys you leave out keep their English text.

import VegaPlayer from './vega-player.js';
VegaPlayer.i18n = {
...VegaPlayer.i18n,
play: 'Reproducir',
pause: 'Pausa',
stop: 'Detener',
seek: 'Buscar',
speed: 'Velocidad',
captions: 'Subtítulos',
quality: 'Calidad',
auto: 'Auto',
mute: 'Silenciar',
volume: 'Volumen',
pip: 'Imagen en imagen',
pipMessage: 'Reproduciendo en modo imagen en imagen',
cast: 'Enviar',
fullscreen: 'Pantalla completa',
exitFullscreen: 'Salir de pantalla completa',
close: 'Cerrar',
errorDefault: 'No se puede cargar el vídeo',
errorAborted: 'Carga del vídeo cancelada',
errorNetwork: 'Error de red',
errorDecode: 'No se pudo descodificar el vídeo',
errorFormat: 'Formato de vídeo no compatible',
};
KeyDefault
play / pause / stopPlay / Pause / Stop
seekSeek
speedPlayback speed
captionsCaptions
quality / autoQuality / Auto
mute / volumeMute / Volume
pip / pipMessagePicture-in-Picture / Playing in Picture-in-Picture mode
castCast
fullscreen / exitFullscreenFullscreen / Exit fullscreen
closeClose
errorDefaultUnable to load video
errorAbortedVideo loading aborted
errorNetworkNetwork error
errorDecodeVideo decoding failed
errorFormatVideo format not supported

Texts that belong to each player are set with attributes: modal-title, modal-description, modal-cta-text, error-title, error-retry-text and captions-label.