Skip to content

jcorry/gootranslate

Repository files navigation

GooTranslate

Latest Version on Packagist Software License Build Status Quality Score Total Downloads

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.