# Translate interface text

Source: https://zotonic.com/docs/1409/translate-interface-text

URI: https://zotonic.com/id/1409

Language: en

Write the source text in English and mark static interface text for translation.

::: {.aside}
Resource content translations are separate from interface strings.
:::

Write the source text in English and mark static interface text for translation.

```django
<button type="submit">{_ Save changes _}</button>
```

Use a translated argument when passing text into an include, for example `title=_"Latest news"`.

Generate the site's POT file when you are updating translations, then merge it into the PO files and translate the new messages. Validate changed PO files with `msgfmt --check`. Test a second language in the browser, including links and form errors.

Extract translation messages
----------------------------

::: {.aside}
Extracting messages does not translate content resources stored in the database.
:::

After changing translatable template text in a site, generate its message catalog:

```sh
bin/zotonic pot garden
```

This connects to the running node and writes translation source files. Use `pot zotonic` only when intentionally updating the core catalogs according to the project's contribution workflow.

Review the resulting POT changes, merge them into the appropriate PO files, and translate new messages. Validate a PO file with gettext tooling:

```sh
msgfmt --check --output-file=/dev/null path/to/language.po
```

Check both the interface text and the selected content language in the browser. See [Translate interface text](/id/1409).

Add a language and choose its availability
------------------------------------------

**Access needed:** Site administrator allowed to manage languages.

1. Open **Structure → Translation** and choose **Add language**.
2. Select the intended language and use **Editable** while preparing its content.
3. Ask editors to translate the main pages, menu labels, and essential messages.
4. Check a representative page in that language and verify fallback behaviour for missing translations.
5. Set the language to **View** when it should be available to visitors.
6. Check the language order: the first **View** language is the default. Test the language switcher and incoming links.
<!-- z-media 2792 {"alt":"Languages overview showing View, Editable, and Off choices and the drag handles for ordering.","caption":"-","size":"large"} -->
This example shows English as the first View language and Arabic as Editable. Use the drag handles to change the preference order.

Changing the default can affect URLs and what new visitors see. Check redirects and search-facing links with the developer before a major language change.

Use **Editable** when hiding a language while retaining an editing workflow. The **Off** option is not an archive switch: the admin warns that subsequent edits can lose translations for an off language. Preserve needed translations before disabling it.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1409?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1409?language=en>)
