gino-pane / laravel-phpolyglot
Laravel package wrapper for PHP package for translation, spelling correction and text-to-speech (TTS) synthesis using external APIs
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^7.1
- gino-pane/phpolyglot: ~1.1
Requires (Dev)
- laravel/framework: ^5.6
README
Laravel package wrapper for PHPolyglot.
Requirements
- PHP >= 7.1;
- Laravel Framework.
Installation
composer require gino-pane/laravel-phpolyglot
As per Laravel 5.5+ service provider and facade will be registered automatically when installing. For previous versions please register service provider and facade manually. Optionally, after package installation please make sure to publish its configuration (if it was not done automatically by composer command):
php artisan vendor:publish --provider="GinoPane\LaravelPhpolyglot\LaravelPhpolyglotProvider" --tag=config
or
composer run-script publish-config -d ./vendor/gino-pane/laravel-phpolyglot
Also make sure to manually put your specific credentials from PHPolyglot's .env
file into Laravel's .env
because automatic changes to .env
are not welcome:
PUSHER_APP_KEY=...
PUSHER_APP_SECRET=...
PUSHER_APP_CLUSTER=...
...
YANDEX_TRANSLATE_API_KEY=...
...
After this you could do something like this in your Laravel's web.php
:
Route::get('/', function () {
echo (string)PHPolyglot::translate('welcome', 'it');
});
...to get nice "benvenuto" string in your browser when accessing your test project's root page.
Usage
Please refer to original PHPolyglot documentation.
Changelog
To keep track, please refer to CHANGELOG.md.
License
Please refer to LICENSE.