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

LanguageLocale code
Englishen
English (United Kingdom)en_GB
Españoles
Español (Guatemala)es_GT
Tiếng Việtvi
Françaisfr
Deutschde
Italianoit
한국어ko
Portuguêspt
简体中文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 locale value takes priority
  • Invalid or unsupported locale codes fall back to English (en)

Did this page help you?