awkaw / laravel-translations
Translate service for Laravel
2.2.0
2023-05-03 09:36 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- chrome-php/chrome: ^0.10.0
- guzzlehttp/guzzle: ^7.0
- stichoza/google-translate-php: ^4.1
- dev-master
- 2.2.0
- 2.1.37
- 2.1.36
- 2.1.35
- 2.1.34
- 2.1.33
- 2.1.32
- 2.1.30
- 2.1.29
- 2.1.28
- 2.1.26
- 2.1.22
- 2.1.21
- 2.1.20
- 2.1.19
- 2.1.18
- 2.1.17
- 2.1.16
- 2.1.15
- 2.1.13
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.36
- 2.0.35
- 2.0.34
- 2.0.33
- 2.0.32
- 2.0.31
- 2.0.29
- 2.0.28
- 2.0.27
- 2.0.26
- 2.0.25
- 2.0.24
- 2.0.23
- 2.0.22
- 2.0.21
- 2.0.20
- 2.0.19
- 2.0.18
- 2.0.17
- 2.0.16
- 2.0.15
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-11-03 13:07:41 UTC
README
Installation
The library can be installed with Composer and is available on packagist under awkaw/laravel-translations:
composer require awkaw/laravel-translations:^2.1
Run the migrations
php artisan migrate
Install Google Chrome browser
docker run -p 9222:9222 --name your_name_for_image --restart always -d awkaw/chrome
Usage
Usage GoogleChromeBrowser
use LaravelTranslations\Services\GoogleTranslateService;
use LaravelTranslations\Services\GoogleTranslate\Providers\GoogleChromeBrowser;
$sourceLocale = 'en';
$targetLocale = 'ru';
$googleChromeAddress = '127.0.0.1:9222'; // enter your address
$sourceText = 'Test translation';
$options = [
"provider" => GoogleChromeBrowser::class,
"googleChromeAddress" => $googleChromeAddress,
"debug" => false,
];
$service = new GoogleTranslateService($sourceLocale, $targetLocale, $options);
$resultText = $service->translate($sourceText);