> For the complete documentation index, see [llms.txt](https://alhena.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alhena.gitbook.io/docs/developer-reference/website-sdk/examples/internationalization.md).

# Internationalization

Configure the Alhena chat widget to display in different languages.

Configure the chat widget's UI language using the `locale` option.

## Automatic Language Detection

By default, Alhena uses the `lang` attribute from your HTML tag:

```html
<html lang="es">
```

If your page has `lang="es"`, the widget UI will display in Spanish.

## Explicit Locale Configuration

To override automatic detection, set the `locale` in your configuration:

```html
<script>
document.gleenConfig = {
    company: 'your-company-key',
    apiBaseUrl: 'https://app.alhena.ai',
    locale: 'es'
};
</script>
<script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>
```

Use standard [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes (e.g., `en`, `es`, `fr`, `de`).

## Switching Language at Runtime

If shoppers can change language without a full page load (for example, a language switcher in a single-page app), call `setLocale()` so the widget follows along:

```javascript
window.gleenWidget.setLocale('fr');
```

The widget re-translates its built-in text and your translated dashboard content, and the AI replies in the new language from the next message. See [`setLocale()`](/docs/developer-reference/website-sdk/javascript-api.md#setlocale-locale).

## Related

* [JavaScript API](/docs/developer-reference/website-sdk/javascript-api.md) - Configuration reference
