# Translation Files

This directory contains translation files for the AI Translator for Polylang plugin.

## Files

- `ai-translator-for-polylang.pot` - The main translation template file
- `ai-translator-for-polylang-es_ES.po` - Spanish translation source file

## How to use

The .po files need to be compiled into .mo files using a tool like msgfmt:

```
msgfmt ai-translator-for-polylang-es_ES.po -o ai-translator-for-polylang-es_ES.mo
```

Or you can use a translation management tool like Poedit to edit and compile the files.

## Adding new translations

1. Copy the .pot file and rename it to your language code (e.g., `ai-translator-for-polylang-fr_FR.po` for French)
2. Translate all strings in the file
3. Compile to .mo format
4. Place both files in this directory

The plugin will automatically detect and use the appropriate language file based on the WordPress site's language setting.

## Translating settings.php and queue.php

The main translation template includes strings from all parts of the plugin, including settings.php and queue.php.

To translate strings in these files, wrap each string in a translation function:

```php
// For text output (gets translated and echoed)
<?php _e('Your text here', 'ai-translator-for-polylang'); ?>

// For text within attributes
<?php esc_attr_e('Button text', 'ai-translator-for-polylang'); ?>

// For text that needs to be returned, not echoed
<?php echo __('Your text here', 'ai-translator-for-polylang'); ?>
```

When translating these strings, be careful to maintain any HTML tags like `<strong>` that might be included in the text.
