setLocale
setLocale(locale): Promise<void>
This function changes the language of every SAS Content SDK component on the page. Components that are already displayed update immediately, without reloading the page. The translated text for the new language is downloaded when it is needed.
Right-to-left languages, such as Arabic and Hebrew, are supported. When a right-to-left language is set, the layout of the components and of their menus, dialogs, and other popovers is mirrored.
Arguments
locale: string
A BCP 47 language tag, such as
en-US, fr-FR, or ja.
Return value
setLocale returns a Promise that resolves after the new language has been applied.
Example
window.addEventListener('contentSdkComponents.loaded', function () {
window.contentSdkComponents.setLocale('fr-FR');
});