# Translation Files

This directory contains translation files for the Easy AI Chatbot plugin.

## Text Domain

**Text Domain:** `easy-ai-chatbot`

## File Structure

- `easy-ai-chatbot.pot` - Translation template file (to be generated)
- `easy-ai-chatbot-{locale}.po` - Translation files for specific languages
- `easy-ai-chatbot-{locale}.mo` - Compiled translation files

## Generating the .pot File

To generate the translation template file, you can use:

### Using WP-CLI:
```bash
wp i18n make-pot . languages/easy-ai-chatbot.pot --domain=easy-ai-chatbot
```

### Using Poedit:
1. Open Poedit
2. Create new translation from source code
3. Select the plugin root directory
4. Set text domain to `easy-ai-chatbot`
5. Save as `easy-ai-chatbot.pot`

## Using the Easy_AI_Chatbot_I18n Helper Class

The plugin includes a helper class to simplify translations:

```php
// Simple translation
echo Easy_AI_Chatbot_I18n::translate( 'Settings saved!' );

// Escaped translation (recommended for output)
echo Easy_AI_Chatbot_I18n::translate_escaped( 'Settings saved!' );

// Echo translated string
Easy_AI_Chatbot_I18n::echo_translate( 'Hello World' );

// Translation with context
$label = Easy_AI_Chatbot_I18n::translate_with_context( 'Post', 'noun' );

// Plural translation
$message = Easy_AI_Chatbot_I18n::translate_plural(
    '%d message',
    '%d messages',
    $count
);
```

## Contributing Translations

To contribute a translation:

1. Copy `easy-ai-chatbot.pot` to `easy-ai-chatbot-{locale}.po` (e.g., `easy-ai-chatbot-es_ES.po`)
2. Translate strings using Poedit or similar tool
3. Compile to `.mo` file
4. Submit via GitHub pull request

## Supported Locales

Translation files will be added here as they become available.

## Notes

- The plugin loads translations on the `plugins_loaded` hook
- Translation files are loaded from this directory
- The text domain is defined in the plugin header
- All user-facing strings should be wrapped in translation functions
