jcorry / gootranslate
Simple API wrapper for Google Translate (REST) API
Requires
- php: ~5.5|~7.0
- guzzlehttp/guzzle: ~6.0
- illuminate/support: ~5.1
Requires (Dev)
- peridot-php/leo: ~1.0
- peridot-php/peridot: ~1.15
- peridot-php/peridot-watcher-plugin: ~1.3
- phpspec/phpspec: ~2.1
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2021-03-03 12:32:45 UTC
README
Simple wrapper for Google Translate (REST) API. Includes a Laravel 5 Service Provider and Facade.
Install
Via Composer
$ composer require jcorry/gootranslate
Or
require : { "jcorry/gootranslate": "dev-master" }
Add your Google API key to .env
GOOGLE_API_KEY=YOUR-KEY-VALUE-HERE
Add provider to your app/config/app.php providers:
Jcorry\GooTranslate\GooTranslateServiceProvider::class
Optional (recommended)
Add alias to app/config/app.php to use facade
'GooTranslate' => Jcorry\GooTranslate\GooTranslateFacade::class
Usage
List available languages...
GooTranslate::languages();
Translate
GooTranslate::translate('Here is a string to translate', 'zu');
Results in...
```
[
{#644
+"translatedText": "Nasi string ukuhumusha",
+"detectedSourceLanguage": "en",
},
]
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email jcorry@gmail.com instead of using the issue tracker.
Credits
License
The DBAD License (DBAD). Please see License File for more information.