> For the complete documentation index, see [llms.txt](https://metabolism.gitbook.io/symfony-wordpress-bundle/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metabolism.gitbook.io/symfony-wordpress-bundle/guides/internationalization.md).

# Internationalization

Internationalization of a theme works pretty much the same way as it does for default WordPress themes. Follow the guide in the [WordPress Theme Handbook](https://developer.wordpress.org/themes/functionality/internationalization/) to setup i18n for your theme.

Twig has its own i18n extension that gives you `{% trans %}` tags to define translatable blocks, but there’s no need to use it.

## Translation functions

Wordpress Bundle add all the translation functions used in WordPress:

* `__()`
* `_x()`
* `_n()`
* `_nx()`
* `_n_noop()`
* `_nx_noop()`
* `translate()`
* `translate_nooped_plural()`

The functions `_e()` and `_ex()` are also supported, but you probably won’t need them in Twig, because `{{ }}` already echoes the output.

```liquid
<p class="entry-meta">{{ __('Posted on', 'my-text-domain') }} [...]</p>
<p class="entry-meta">{{ __('Posted on %s', 'my-text-domain')|format(post.date) }}</p>
```

## Generating localization files

To generate `.pot`, `.po` and `.mo` files, you need a tool that supports parsing Twig files to detect all your translations. While there are a lot of tools that can parse PHP files, the solution that works best for Twig files is [Poedit](https://poedit.net/).

#### Generating l10n files with Poedit 2&#x20;

[Poedit 2](https://poedit.net/) fully supports Twig file parsing (Pro version only) with the following functions: `__(), _x(), _n(), _nx()`.

{% hint style="info" %}
Store .mo and .po into the /translations folder
{% endhint %}
