GenAI Chat Language
Configure the GenAI Embeddable Widget UI language on initialization or update it at runtime.
Default language
English (en) — used when no locale is set or an invalid value is provided.
Available languages
| Language | Locale code |
|---|---|
| English | en |
| English (United Kingdom) | en_GB |
| Español | es |
| Español (Guatemala) | es_GT |
| Tiếng Việt | vi |
| Français | fr |
| Deutsch | de |
| Italiano | it |
| 한국어 | ko |
| Português | pt |
| 简体中文 | zh_CN |
Script Tag Attributes
data-locale
Type: String
Required: No
Default: "en"
Widget UI language. Use any locale code from the table above.
<script
src="%SCRIPT_URL%/genai-embeddable-widget.js"
data-api-key="%API_KEY%"
data-locale="en"
></script>
Programmatic Options (WidgetInitConfig)
locale
Type: String
Required: No
Default: "en"
Initial widget UI language. Overrides data-locale when both are set.
var widget = new GenAIEmbeddableWidget({
apiKey: '%API_KEY%',
locale: 'es',
});
Widget Control Events
genai-widget:set-locale
Updates the widget locale at runtime without reloading the page.
window.dispatchEvent(new CustomEvent('genai-widget:set-locale', {
detail: { locale: 'es' },
}));
Public Methods
setLocale(locale)
Updates the widget locale at runtime. Use any locale code from the table above.
widget.setLocale('es');
Notes:
- If both the script attribute and the JavaScript option are set, the JavaScript
localevalue takes priority - Invalid or unsupported locale codes fall back to English (
en)
Updated about 2 hours ago
Did this page help you?
