> For the complete documentation index, see [llms.txt](https://docs.wonderchat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wonderchat.io/setup-guides/setting-up-your-chatbot/setting-up-multi-lingual-chatbots.md).

# Multi-lingual Chatbots

How to serve visitors in more than one language: reply language, adding languages with translated widget text, and picking the language per page.

There are two parts to running your agent in several languages:

* **The agent's answers.** The AI can answer in whatever language the visitor writes in. This works on every plan.
* **The fixed text in the widget.** Greetings, lead questions, workflow messages, handover messages and other text you wrote yourself. To show these in more than one language, add languages to your agent.

***

## Answers in the visitor's language

1. Go to **Agents** and click **Edit** on your agent's card.
2. Open **Model & Behavior** (in the **Agent** group).
3. Under **Answers**, set **Reply language** to **Match the visitor's language**.

To always answer in one language, whatever the visitor writes, pick **Always \[language]** instead.

***

## Add a language

{% hint style="info" %}
Adding languages is available on the **Starter** plan and above.
{% endhint %}

1. Go to **Agents** and click **Edit** on your agent's card.
2. In the **Profile** tab, find the **Languages** card. It lists your default language and any languages you've added.
3. Click **Add language**.
4. Pick a **Language**, then fill in the translations (see below).
5. Click **Add \[language]**, for example **Add Spanish**.

<figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-37b66bef44beaa8ef89bf8246d73291022382f78%2Flanguage-editor.png?alt=media" alt="The Add a language window with Spanish selected, sections on the left and Translate missing at the bottom"><figcaption><p>Adding Spanish</p></figcaption></figure>

Once the agent has more than one language, a language picker (globe icon) shows in the widget header, so visitors can switch.

### Fill in the translations

The editor lists your agent's text in sections on the left. You only see the sections that have text to translate, for example:

* **Chat**: greeting, suggested questions, survey message, links and other chat text.
* **Lead collection**: the name, email and phone questions, consent text and custom field questions.
* **Workflows**: every step with fixed text in each workflow, such as messages, questions and consent checkboxes.
* **Handover**: the handover request and confirmation messages.
* **Homepage**: the home page header, message card and announcements, if you use a home page.
* **Auto-switch**: see [Pick the language by page](#pick-the-language-by-page).

Each section shows how many of its fields are done, and the footer shows the total, for example **4 of 9 translated**. Empty fields show your default language text to visitors.

Click **Translate missing** to have the AI fill every empty field. Nothing is saved until you review the translations and save.

### Edit or delete a language

On the **Languages** card, each language shows how much is translated, for example **6 of 9 translated**, or **Not translated yet**. Click a language, or open its **⋯** menu and choose **Edit translations**. Make your changes and click **Save translations**.

To remove a language, open its **⋯** menu and choose **Delete**. Visitors then see your default language instead.

{% hint style="info" %}
When you change text in your default language later, for example a new greeting, update its translations too. Open **Edit translations** and use **Translate missing** or edit the fields yourself.
{% endhint %}

***

## Which language a visitor sees

When a visitor opens the widget, it picks a language in this order:

1. The language set in your embed code with `data-default-language` or `data-language`, if any.
2. The language whose **Auto-switch** rule matches the page URL.
3. The first of the visitor's browser languages that your agent offers.
4. English, if your agent offers it.
5. Your default language.

Visitors can always change it with the language picker in the widget header.

### Pick the language by page

If your site has a separate section per language, such as `/fr/` or `?lang=fr`, open the language's **Edit translations** and go to **Auto-switch**. Under **Switch to \[language] when the page URL contains**, add the parts of the URL that mark that language, separated by commas.

You can also set the language in the embed code on each page instead. See [Advanced widget parameters](https://docs.wonderchat.io/setup-guides/adding-your-chatbot-to-your-website/advanced-widget-parameters.md).

***

## Other ways to set it up

**One agent per language.** Create a separate agent for each language and embed each one on its own pages. Each agent then has its own knowledge base, which helps if you keep separate content or teams per language. The downside is more agents to manage.

**Change only the greeting (any plan).** Add `data-greeting` to the embed code on each language's pages to override the greeting:

```html
<script
    src="https://app.wonderchat.io/scripts/wonderchat.js"
    data-name="wonderchat"
    data-address="app.wonderchat.io"
    data-id="YOUR_AGENT_ID"
    data-greeting="Bonjour ! Comment puis-je vous aider ?"
    defer
></script>
```

***

If you have any more questions, feel free to reach out to us at <mark style="color:purple;">**<support@wonderchat.io>**</mark>
