| 1 |
<?php |
| 2 |
|
| 3 |
namespace AATXT\App\AIProviders\Contracts; |
| 4 |
|
| 5 |
/** |
| 6 |
* Interface for AI providers that support text translation. |
| 7 |
* |
| 8 |
* Following the Interface Segregation Principle, this interface defines |
| 9 |
* only the methods related to translation capabilities. |
| 10 |
*/ |
| 11 |
interface SupportsTranslation |
| 12 |
{ |
| 13 |
/** |
| 14 |
* Translate text to the specified target language. |
| 15 |
* |
| 16 |
* @param string $text The text to translate |
| 17 |
* @param string $targetLanguage The target language code (e.g., 'it', 'es', 'fr') |
| 18 |
* @return string The translated text |
| 19 |
*/ |
| 20 |
public function translate(string $text, string $targetLanguage): string; |
| 21 |
|
| 22 |
/** |
| 23 |
* Check if translation is enabled and configured. |
| 24 |
* |
| 25 |
* @return bool True if translation is available, false otherwise |
| 26 |
*/ |
| 27 |
public function isTranslationEnabled(): bool; |
| 28 |
|
| 29 |
/** |
| 30 |
* Get the configured target language for translation. |
| 31 |
* |
| 32 |
* @return string The language code, or empty string if not configured |
| 33 |
*/ |
| 34 |
public function getTargetLanguage(): string; |
| 35 |
} |
| 36 |
|