# Plugin translations

The plugin uses the WordPress i18n system with **text domain**: `tr_free_whistleblowing_solution`.

## Included languages

Pre-translated `.po` files are provided for:

| Locale | Language   | File |
|--------|------------|------|
| de_DE  | German     | `tr_free_whistleblowing_solution-de_DE.po` |
| es_ES  | Spanish    | `tr_free_whistleblowing_solution-es_ES.po` |
| fr_FR  | French     | `tr_free_whistleblowing_solution-fr_FR.po` |
| it_IT  | Italian    | `tr_free_whistleblowing_solution-it_IT.po` |
| nl_NL  | Dutch      | `tr_free_whistleblowing_solution-nl_NL.po` |
| pl_PL  | Polish     | `tr_free_whistleblowing_solution-pl_PL.po` |
| pt_BR  | Portuguese (Brazil) | `tr_free_whistleblowing_solution-pt_BR.po` |

WordPress loads **`.mo`** files at runtime. Compile each `.po` to `.mo` (see below) and place the `.mo` in this folder.

## Compile .po to .mo

From this `languages/` directory, with [GNU gettext](https://www.gnu.org/software/gettext/) installed:

```bash
msgfmt -o tr_free_whistleblowing_solution-de_DE.mo tr_free_whistleblowing_solution-de_DE.po
msgfmt -o tr_free_whistleblowing_solution-es_ES.mo tr_free_whistleblowing_solution-es_ES.po
msgfmt -o tr_free_whistleblowing_solution-fr_FR.mo tr_free_whistleblowing_solution-fr_FR.po
msgfmt -o tr_free_whistleblowing_solution-it_IT.mo tr_free_whistleblowing_solution-it_IT.po
msgfmt -o tr_free_whistleblowing_solution-nl_NL.mo tr_free_whistleblowing_solution-nl_NL.po
msgfmt -o tr_free_whistleblowing_solution-pl_PL.mo tr_free_whistleblowing_solution-pl_PL.po
msgfmt -o tr_free_whistleblowing_solution-pt_BR.mo tr_free_whistleblowing_solution-pt_BR.po
```

Or use [Poedit](https://poedit.net/): open each `.po` and save; Poedit creates the `.mo` automatically.

## For translators

1. To add a new language: copy `tr_free_whistleblowing_solution.pot` to a new file named by locale, e.g. `tr_free_whistleblowing_solution-de_DE.po`.
2. Fill in the `msgstr` entries in the `.po` file with your translations.
3. Compile the `.po` to a `.mo` file (see above).

Place both the `.po` and `.mo` files in this `languages/` folder. WordPress will load the translation when the site locale matches (e.g. German when site language is Deutsch).

## Updating the POT template

When new translatable strings are added to the plugin, update the `.pot` so translators can sync. From the project root (WordPress install), you can regenerate it with [WP-CLI](https://wp-cli.org/):

```bash
wp i18n make-pot storage/wp-plugin storage/wp-plugin/languages/tr_free_whistleblowing_solution.pot --domain=tr_free_whistleblowing_solution
```

Or use the [WordPress i18n tools](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/) and add any new `msgid` entries to the `.pot` manually.
