datlechin / laravel-google-translate
Free Google Translate API for Laravel application.
Installs: 12 895
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/support: ^10.0|^11.0
README
This package allows you to free translate your Laravel app easily using the Google Translate API.
Installation
You can install the package via composer:
composer require datlechin/laravel-google-translate
Usage
use 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(); // en
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email datlechin@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.