> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyreach.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Languages

> Show the widget, its starters and its greeting in each visitor's language, and tell the agent which one to answer in.

A widget can speak more than one language. It picks one for each visitor, shows its own buttons and labels in it, shows your texts (title, greeting, conversation starters, buttons, forms and feedback) in it, and tells the agent to answer in it.

A widget with languages off works exactly as before. Turn them on from the widget's **Languages** tab, saying which language your texts are written in; that becomes the default language.

Turning languages off deletes nothing. The widget goes back to working as one without languages and shows every text in its default language, while the other languages, link rules and settings are kept. Turning them back on restores everything.

## How the widget picks a language

Signals are tried in a fixed order. The first one that names a language the widget supports wins.

| Order | Signal | Notes |
| - | - | - |
| 1 | Your page calls `window.anyreach.setLocale('fr')` | For sites with their own language switcher. See [Host page events](/web-widgets/host-page-events). |
| 2 | Link rules | `https://ca.ooni.com/fr/**` or `/de-de/**` → a language. The first rule that matches the page wins. |
| 3 | The page's language | The page's `<html lang>`. On by default. Shopify Markets and most site builders set it. |
| 4 | The visitor's browser | `navigator.languages`. On by default. |
| 5 | The default language | Always last. |

The language decides, never the region: a page in `en-FR` (English for France) gets English. A regional language you list, such as `fr-CA`, is used for that region and reached from plain `fr` too. Nothing is guessed from a path or subdomain; use a link rule for a site whose pages don't set their language.

The widget follows the visitor as they move between pages. When the language changes mid-conversation, the widget redraws in it and the agent is told on the visitor's next message.

## What is translated

* **The widget's own words.** Buttons, labels, placeholders and messages ship in English, French, German, Italian and Spanish. You can change any of them, in any language, under **Widget wording** on the General tab.
* **Your texts.** The title, greeting, conversation starters, buttons, forms and feedback.
* **The opening.** The agent's own greeting stays as written. To greet visitors in their language, set a **Custom** starting message and buttons in the widget's **Starters** and write them in each language; a preset shares them across widgets. A dynamic agent greeting needs nothing: the agent is told the visitor's language and greets in it.

## Writing each language

The **Languages** tab holds the settings above. To write the texts, pick a language in the **Editing** bar above the tabs. Every text field on General, Starters and Theming then edits that language, in the same place you wrote the default. Under each field you see the default-language text and whether this language has its own:

* **Not translated** means visitors in that language see the default text.
* **Translated** means you wrote it.
* **AI translated** means **Translate missing** filled it with Claude. Editing it removes the mark.

**Translate missing** fills the empty texts of the picked language. The words you list under **Keep these words as written** (brand and product names) are never translated, and `{{page values}}` stay as they are.

Colours, icons, the number of questions and buttons, and every other setting are the same in every language. Translations stay with a text when you reorder, remove or rename items in any language.

## What the agent is told

A conversation from a widget with languages on starts with one line of context, for example: *Visitor interface language: French (fr). Reply in French unless the visitor writes in another language; keep product and brand names as written.* It is not part of the agent's instructions, so instructions stay cacheable.

Agent instructions can also read `{{ locale }}` (`fr`) and `{{ language }}` (`French`), but they rarely need to: the line above already tells the agent. Putting either in the instructions makes them differ per language, which turns off prompt caching for that agent. The conversation records the language and what picked it in its system metadata (`locale`, `locale_source`).

## Analytics

Visits record the language the widget spoke, and the widget's [Analytics](/web-widgets/analytics) page filters by it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.