A driver-based translation package for Laravel.
You can install the package via composer:
composer require worksome/translator
You 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
// Via the Facade
use Worksome\Translator\Facades\Translator;
Translator::translate(''); // Use the default driver
Translator::driver('google_cloud_translate')->translate('', 'en', 'da'); // Use a custom driver
Test suites can utilise the null
driver, this will always return the same string value as provided for translations.
composer test
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.