This package allows you to free translate your Laravel app easily using the Google Translate API.
You can install the package via composer:
composer require datlechin/laravel-google-translateuse Datlechin\GoogleTranslate\Facades\GoogleTranslate;
// Using facade
$result = GoogleTranslate::source('en')
->target('vi')
->translate('Hello world!');
$result->translatedText(); // Chào thế giới!
$result->getAlternativeTranslations();
//[
// [
// 0 => 'Chào thế giới!',
// 1 => 'Xin chào thế giới!',
// 2 => 'Chào cả thế giới!',
// ],
//]
$result->getSourceText(); // Hello world!
$result->getSourceLanguage(); // enPlease see CONTRIBUTING for details.
If you discover any security related issues, please email datlechin@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.