First, please add to our installation script:
window.EquallyAI = {
updateSettings: (type, settings) =>
window.addEventListener('equally-ai:ready', () => window.EquallyAI.updateSettings(type, settings)),
};
Eventually, it will look like the next:
Then, to programmatically change the language of the Equally AI widget, please use the following line of code:
<script>
window.EquallyAI.updateSettings('currentLanguage',language)
</script>
Replace language
with the appropriate language code from the list below.
Supported Languages
You can use any of the following language codes to set the widget's language dynamically:
const langNames = {
en: 'English (EN)',
ru: 'Русский (РУС)',
he: 'עברית (HE)',
de: 'Deutsch (DE)',
es: 'Español (ES)',
pt: 'Português (PT)',
bg: 'Български (BG)',
se: 'Svenska (SE)',
it: 'Italiano (IT)',
fr: 'Français (FR)',
cz: 'Čeština (CZ)',
dk: 'Dansk (DK)',
fi: 'Suomi (FI)',
gr: 'Ελληνικά (GR)',
hr: 'Hrvatski (HR)',
lt: 'lietuvių (LT)',
lv: 'Latviešu (LV)',
nl: 'Nederlands (NL)',
pl: 'Polski (PL)',
ro: 'Română (RO)',
sl: 'Slovenian (SL)',
mt: 'Maltese (MT)',
sk: 'Slovak (SK)',
ar: 'Arabic (AR)',
ja: 'Japanese (JA)',
zh: 'Chinese (ZH)',
ko: 'Korean (KO)',
sq: 'Albania (SQ)',
mk: 'Macedonian (MK)',
};
Use this map to select the appropriate language code for your users.