# Translation Files

This directory contains translation files for the Stylish Top Author Widget plugin.

## How to Add a New Language

1. Copy `staw.pot` to your language file, e.g., `staw-es_ES.po`
2. Translate all the strings in the `.po` file
3. Compile the `.po` file to `.mo` using:
   ```bash
   msgfmt -o staw-es_ES.mo staw-es_ES.po
   ```

## Using WP-CLI for Translations

If you have WP-CLI installed, you can generate and update translations:

```bash
# Update the .pot file with new strings
wp i18n make-pot . languages/staw.pot --domain=staw

# Create a new translation file
wp i18n make-po languages/staw.pot languages/staw-<locale>.po

# Compile .po to .mo
wp i18n make-mo languages languages
```

## Adding New Translatable Strings

When adding new strings to the plugin:

- PHP: Use `__('String', 'staw')` or `__('String', 'staw')`
- JavaScript: Use `__('String', 'staw')` from `@wordpress/i18n`

Always run `wp i18n make-pot` after adding new strings.
