Skip to main content

Translation

For new applications, prefer using TEW integration for translation.

getTranslation(componentName)

Returns a promise that resolves with the translation object for the given component name.

Usage: window.e.utils.v2.translation.getTranslation(componentName)

Parameters

NameTypeRequiredDescription
componentNamestringyesName of the component to get translations for

Example

const translations = await window.e.utils.v2.translation.getTranslation('event-content-decision');
const translatedTitle = translations['event-content-decision'].title;

getTranslations(componentNames)

Same as getTranslation but accepts an array of multiple component names and returns translations for all of them.

Usage: window.e.utils.v2.translation.getTranslations(componentNames)

Parameters

NameTypeRequiredDescription
componentNamesstring[]yesArray of component names

Example

const translations = await window.e.utils.v2.translation.getTranslations([
'example',
'event-content-decision'
]);
const title = translations['example'].title;