# Translation Files

This directory contains translation files for the Maintenance Reports by webcycle plugin.

## Files in this directory

- **maintenance-reports-by-webcycle.pot** - Template file containing all translatable strings. This is the master file that translators use as a base.

## How to create a translation

### Quick Start (Using WP-CLI)

1. **Copy the .pot file to create a new language file:**
   ```bash
   cp maintenance-reports-by-webcycle.pot maintenance-reports-by-webcycle-es_ES.po
   ```
   (Replace `es_ES` with your language code, e.g., `fr_FR`, `de_DE`, etc.)

2. **Edit the header in the .po file:**
   - Change `Language: \n` to `Language: es_ES\n`
   - Update `Last-Translator:` with your name and email
   - Set appropriate `Plural-Forms` for your language

3. **Translate the strings:**
   - Use Poedit (https://poedit.net/) - recommended GUI tool
   - Or edit manually: translate the `msgstr` entries

4. **Compile to .mo file:**
   ```bash
   wp i18n make-mo languages/
   ```
   Or using Poedit: it compiles automatically when you save

### Example: Spanish Translation

```bash
# 1. Create Spanish .po file
cp maintenance-reports-by-webcycle.pot maintenance-reports-by-webcycle-es_ES.po

# 2. Edit with Poedit and translate all strings

# 3. Compile to .mo
wp i18n make-mo languages/
# OR
msgfmt -o maintenance-reports-by-webcycle-es_ES.mo maintenance-reports-by-webcycle-es_ES.po
```

## File naming convention

- Template: `{text-domain}.pot`
- Translation: `{text-domain}-{language}_{country}.po`
- Compiled: `{text-domain}-{language}_{country}.mo`

Examples:
- `maintenance-reports-by-webcycle.pot` (template)
- `maintenance-reports-by-webcycle-es_ES.po` (Spanish - Spain)
- `maintenance-reports-by-webcycle-es_ES.mo` (compiled Spanish)
- `maintenance-reports-by-webcycle-fr_FR.po` (French - France)
- `maintenance-reports-by-webcycle-de_DE.po` (German - Germany)

## Language codes

Common language codes:
- English (US): `en_US`
- Spanish (Spain): `es_ES`
- French (France): `fr_FR`
- German (Germany): `de_DE`
- Italian (Italy): `it_IT`
- Portuguese (Brazil): `pt_BR`

Full list: https://www.gnu.org/software/gettext/manual/html_node/Country-Codes.html

## Updating the .pot file

When the plugin is updated with new translatable strings:

```bash
cd /path/to/plugin
wp i18n make-pot . languages/maintenance-reports-by-webcycle.pot --domain=maintenance-reports-by-webcycle --skip-js
```

Then translators should merge new strings into their existing `.po` files using Poedit's "Update from POT file" feature.

## More information

See `TRANSLATION-GUIDE.md` in the plugin root directory for detailed instructions.

