Introduced new Data Transfer Objects (DTOs), exceptions, and jobs to enhance the translation service functionality. Updated namespaces for consistency and added rate limiting to the translation provider. Expanded the README with detailed usage instructions.
17 lines
588 B
PHP
17 lines
588 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace KorElf\TranslateLaravel\Contracts;
|
|
|
|
use KorElf\TranslateLaravel\DTO\Languages;
|
|
use Illuminate\Contracts\Foundation\Application;
|
|
|
|
interface Translate
|
|
{
|
|
public static function init(Application $app, array $config = []): self;
|
|
|
|
public function translateText(string|array $text, string $targetLanguageCode, ?string $sourceLanguageCode = null): string|array;
|
|
|
|
public function translateHtml(string|array $text, string $targetLanguageCode, ?string $sourceLanguageCode = null): string|array;
|
|
|
|
public function listLanguages(): Languages;
|
|
} |