# Multi-language support

Translate your widget into multiple languages and let the widget pick the right one for each visitor automatically.

## How the widget picks a language

When a visitor opens the chat, the widget reads the page's language and looks for a translation that matches. If you have a Danish tab and the visitor lands on a Danish page, they see Danish copy. If no translation matches, the widget falls back to your primary language.

## What the primary language does

The primary language is the fallback that visitors see when no translation matches their page language. When you enable multi-language, the language you pick — the one your existing copy is written in — becomes the primary. You can change which language is primary at any time from the widget configuration.

## What happens with empty fields

Inside a translation, you can leave individual fields empty. An empty field on a non-primary tab falls back to the primary tab's value for that field. So if you only translate the greeting on a German tab and leave the input placeholder blank, German visitors see the German greeting and the primary-language placeholder.

## Enabling multi-language

Multi-language is included on the Pro and Business plans. Open your widget configuration, click "Enable multiple languages", and pick the language your current copy is written in. The widget will create a tab for that language using your existing values and mark it as primary. You can then add more languages from the dropdown.

## Adding, removing, and reordering languages

Add a language by clicking "+ Add language" on the tab bar — you'll get a dropdown of all supported languages with the ones you've already added filtered out. Remove a language by clicking the × on its tab; the primary tab can't be removed. To change which language is primary, switch to a non-primary tab and click "Make primary".

## Example

Suppose your widget has Danish (primary) and English tabs configured.

- A visitor on a Danish page (html lang="da") sees Danish copy.
- A visitor on an English page (html lang="en") sees English copy.
- A visitor on a French page sees Danish copy — French isn't configured, so the widget falls back to the primary language.

## Language detection in detail

1. The widget reads the html lang attribute of the page it's loaded on.
2. If that's missing, it reads the visitor's browser language (navigator.language).
3. If neither is available, it falls back to English ('en').

Region codes are stripped before matching: "en-US", "en-GB", and "en" all match an "en" tab. "zh-CN" matches a "zh" tab.
