A driver-based translation package for Laravel.
You can install the package via composer:
composer require worksome/translatorYou can publish the config file with:
php artisan vendor:publish --tag="translator-config"$translator = new \Worksome\Translator\TranslationManager();
$translator->driver('google_cloud_translate')->translate('Text to translate', 'en', 'da'); // TranslationDTO
$translator->driver('google_cloud_translate')->detectLanguage('Text to detect'); // DetectedLanguageDTO// Use the default driver
\Worksome\Translator\Facades\Translator::translate('');
// Use a custom driver
\Worksome\Translator\Facades\Translator::driver('google_cloud_translate')->translate('', 'en', 'da');Test suites can utilise the null driver, this will always return the same string value as provided for translations.
composer testPlease see GitHub Releases for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.