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

# Writing in several languages

> One campaign, one version per language, each person gets theirs.

Lekalao knows who to write to in which language, and lets you write each e-mail in as many languages as you need. **Every language there is** is accepted (ISO 639-1 codes), with a region when you need one: `fr`, `en`, `sw`, `pt-BR`.

## Each subscriber's language

| Level      | Setting                                  | Role                                                        |
| ---------- | ---------------------------------------- | ----------------------------------------------------------- |
| List       | **Language of the list** (list settings) | The default language of its subscribers.                    |
| Subscriber | **Language** (the subscriber's record)   | Replaces the list's for this person. Empty: the list's own. |

A subscriber's language arrives through:

* their record, in the interface;
* the subscription form (the `locale` field);
* an import (a *langue*, *language*, *lang* or *locale* column, as a code or a name: `fr`, `Français`, `French`);
* the API (`locale`);
* **their preferences page**, where they choose it themselves.

The public pages (confirmation, unsubscribe, preferences) and the system e-mails (confirmation, welcome) appear in that language when the interface knows it, and in the installation's default language otherwise.

## Writing a translated version

Above the editor of a campaign, an automation e-mail or a transactional template, the **language tabs**:

<Steps>
  <Step title="The base version">
    The first tab is the base version, in the list's language. It is what
    anyone whose language has no version receives.
  </Step>

  <Step title="Add a language">
    **Add a language**, type a few letters ("span", "swah"), choose. A tab
    appears.
  </Step>

  <Step title="Write the translation">
    In the tab, the **subject** and the **content** belong to that
    language; the preview shows them with the matching `lang` attribute.
    The template, the editor and the settings are shared by every version.
  </Step>

  <Step title="Save">
    **Save** saves every version at once. A version left entirely empty is
    not kept; the cross on a tab removes the language.
  </Step>
</Steps>

## Who gets what

For each subscriber, Lekalao takes:

1. the version of **their exact language** (`pt-BR`);
2. failing that, the version of **the language without its region** (`pt`);
3. failing that, the **base version**.

A **translated subject left empty** falls back to the base subject, and translated content left empty falls back to the base content: you may translate the subject alone.

The e-mail that goes out carries the language in its `<html lang="…">` tag, which helps screen readers and some filters.

## Sending to one language

To write to one language only, create a [segment](/contacts/segments) with **Language is…**. "Portuguese" takes in `pt` and `pt-BR`; "Portuguese (Brazil)" means `pt-BR` alone.

<Note>
  The versions of an **A/B test** are not translated: a campaign in an A/B
  test has no language tabs. To test two subjects in two languages, make two
  campaigns, each on a language segment.
</Note>

## Transactional e-mails

Your application chooses the language on every send, with the `locale` parameter:

```json theme={null}
{
    "template": "order-confirmation",
    "to": ["ada@example.com"],
    "locale": "en"
}
```

Without `locale`, the base version goes out. See [Transactional e-mails through the API](/developers/transactional#in-several-languages).
