Translation

Calling the function will return a promise that will be resolved with the translation of the given component name. For more information, please read the full documentation.

const componentName = 'event-content-decision';
const translations = await window.e.utils.getTranslation(componentName);
const translatedTitle = translations[componentName].title;
const componentName1 = 'example';
const componentName2 = 'event-content-decision';
const translations = await window.e.utils.getTranslations([componentName1, componentName2]);
const firstComponentTitle = translations[componentName1].title;
const secondComponentTitle = translations[componentName2].title;

Method

Name Description
window.e.utils.getTranslation(componentName) Returns promise that resolves with the translation object.
window.e.utils.getTranslations([componentName1, componentName2]) Returns promise that resolves with the translation object for multiple components.