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

# Translation

Translation files are located in the `.chainlit/translations` directory. The files are named after the language code, e.g. `en-US.json` for English (United States).

<Note>
  The language is dynamically set for each user based on the language of the
  browser. The default language is `en-US`.
</Note>

## Customizing UI text

In addition to standard translations, you can customize the text of front-end components used within the UI. Each UI element is associated with a unique translation key in the translation files. By modifying these keys, you can personalize or localize the UI text according to your needs.

For example, to change the label of a navigation tab from "Readme" to "Documentation", locate the corresponding key in your translation file (e.g., `components.organisms.header.readme`) and update the value:

```json theme={null}
"components.organisms.header.readme": "Documentation"
```

## Customizing the chat watermark

The disclaimer text shown below the chat input ("LLMs can make mistakes. Check important info.") is defined under the `chat.watermark` key in your translation file:

```json theme={null}
"chat": {
  "watermark": "LLMs can make mistakes. [See our privacy policy](https://example.com/privacy)."
}
```

The watermark text supports Markdown, so you can add links (e.g. to a privacy policy or usage notes) and basic formatting like `**bold**` and `*italic*`.

<Note>
  Markdown in the watermark is supported since version **2.9.1**.
</Note>

## Built-in languages

Chainlit ships with translations for the following languages:

| Code    | Language                          |
| ------- | --------------------------------- |
| `ar-SA` | Arabic (Saudi Arabia)             |
| `bn`    | Bengali                           |
| `da-DK` | Danish (Denmark)                  |
| `de-DE` | German (Germany)                  |
| `el-GR` | Greek (Greece)                    |
| `en-US` | English (United States) — default |
| `es`    | Spanish                           |
| `fr-FR` | French (France)                   |
| `gu`    | Gujarati                          |
| `he-IL` | Hebrew (Israel)                   |
| `hi`    | Hindi                             |
| `it`    | Italian                           |
| `ja`    | Japanese                          |
| `kn`    | Kannada                           |
| `ko`    | Korean                            |
| `ml`    | Malayalam                         |
| `mr`    | Marathi                           |
| `nl`    | Dutch                             |
| `pt-PT` | Portuguese (Portugal)             |
| `ta`    | Tamil                             |
| `te`    | Telugu                            |
| `zh-CN` | Chinese (Simplified)              |
| `zh-TW` | Chinese (Traditional)             |

## Adding a new language

To add a new language, create a new file in the `.chainlit/translations` directory with the language code as the filename. The language code should be in the format of `languageCode-COUNTRYCODE`, e.g. `en-US` for English (United States) or `en-GB` for English (United Kingdom).

## Lint translations

To lint the translations, run the following command:

```bash theme={null}
chainlit lint-translations
```

## Translate chainlit.md file

You can define multiple translations for the `chainlit.md` file. For instance `chainlit_pt-BR.md` for Portuguese (Brazil) and `chainlit_es-ES.md` for Spanish (Spain).
The file will be loaded based on the browser's language, defaulting to `chainlit.md` if no translation is available.

## Resetting

To reset the the translations, remove the `.chainlit/translations` directory and restart your Chainlit application:

```bash theme={null}
chainlit run my-app.py
```
