PHP code example of cyllene-digital / ai-translation-bundle
1. Go to this page and download the library: Download cyllene-digital/ai-translation-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cyllene-digital / ai-translation-bundle example snippets
// config/bundles.php
CylleneDigital\AiTranslationBundle\CylleneDigitalAiTranslationBundle::class => ['all' => true],
use CylleneDigital\AiTranslationBundle\Message\GenerateSuggestionsMessage;
use Symfony\Component\Messenger\MessageBusInterface;
final class TranslateCatalogue
{
public function __construct(private readonly MessageBusInterface $bus)
{
}
public function __invoke(): void
{
// catalogue, target locale, source locale
$this->bus->dispatch(new GenerateSuggestionsMessage('messages', 'fr', 'en'));
}
}