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

# Multi-language support

> How InboxMate detects visitor language and serves content in English or German.

InboxMate supports English and German. The widget automatically adapts to each visitor's language.

## How language detection works

The widget determines the visitor's language in this order:

<Steps>
  <Step title="Stored preference">
    If the visitor has previously interacted with the widget and a language preference was saved, that preference is used.
  </Step>

  <Step title="Browser language">
    The widget reads the browser's language setting (`navigator.language`). If it starts with `de`, German is used.
  </Step>

  <Step title="Default fallback">
    If neither condition matches, English is used as the default.
  </Step>
</Steps>

## What adapts to language

| Element                   | Behavior                                                            |
| ------------------------- | ------------------------------------------------------------------- |
| **Greeting message**      | Shows the greeting in the detected language                         |
| **Quick questions**       | Displays the matching language set                                  |
| **Delayed messages**      | Timed engagement messages use the detected language                 |
| **Human handover labels** | UI labels for human support adapt                                   |
| **Widget UI**             | Buttons, placeholders, and system text follow the detected language |

## Setting up multi-language content

When configuring your agent, you can provide content in both languages:

1. **Greeting message** — write an English and a German version
2. **Quick questions** — configure up to 10 per language
3. **System prompt** — instruct your agent to respond in the visitor's language

<Tip>
  Add a line to your system prompt like: "Always respond in the same language the visitor uses. You support English and German."
</Tip>

## Widget language configuration

When embedding, you can set the language mode:

```javascript theme={null}
window.PSquaredChat.init({
  agentId: 'your-agent-id',
  uiLang: 'multi' // 'en', 'de', or 'multi' (auto-detect)
});
```

| Value   | Behavior                                           |
| ------- | -------------------------------------------------- |
| `en`    | Always use English, regardless of browser language |
| `de`    | Always use German                                  |
| `multi` | Auto-detect from browser language (recommended)    |
