# Translations (wp-agent-companion)

The German source strings are the msgids. A site running `en_US` loads the English
translation; a `de_DE` or default site shows the German source (no file needed).

## Files

- `wp-agent-companion.pot` — extraction template (all translatable strings).
- `wp-agent-companion-en_US.po` — English translations (editable source of truth).
- `wp-agent-companion-en_US.mo` — compiled binary catalog (classic gettext fallback).
- `wp-agent-companion-en_US.l10n.php` — WordPress 6.5+ PHP translation file. This is
  what WordPress 6.9+ loads (no gettext PHP extension required); the `.mo` is the
  fallback for older cores.

Loaded via `load_plugin_textdomain( 'wp-agent-companion', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' )`
on the `init` hook (see `wp-agent-companion.php`).

## Regenerate after changing source strings

```bash
# 1. Re-extract the template from the PHP source
wp i18n make-pot . languages/wp-agent-companion.pot --domain=wp-agent-companion --exclude=vendor,languages --skip-audit

# 2. Merge new/changed strings into the English .po (keeps existing translations)
msgmerge --update --backup=none languages/wp-agent-companion-en_US.po languages/wp-agent-companion.pot

# 3. Translate any new msgstr entries by hand in the .po, then compile:
msgfmt --check-format -o /dev/null languages/wp-agent-companion-en_US.po
wp i18n make-mo languages/wp-agent-companion-en_US.po languages/wp-agent-companion-en_US.mo
wp i18n make-php languages
```

Run from the plugin root (`packages/wp-agent-companion`). To add another locale,
copy the `-en_US` pair to the new locale suffix (e.g. `-fr_FR`) and translate.
