bedita / i18n-google
BEdita I18n Google plugin supporting PHP >= 8.3
v1.1.0
2024-12-06 14:20 UTC
Requires
- php: >=8.3
- bedita/i18n: ^5.1.0
- cakephp/utility: ^4.5
- google/cloud-translate: ^1.15
Requires (Dev)
- cakephp/cakephp: ^4.5
- cakephp/cakephp-codesniffer: ~4.7.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2024-12-09 15:19:34 UTC
README
Installation
You can install this plugin into your application using composer.
The recommended way to install composer packages is:
composer require bedita/i18n-google
Note: php version supported is >= 8.3.
Google Cloud Translation
This plugin uses Google Cloud Translation for PHP to translate texts, via google-cloud-php-translate.
Usage example:
use BEdita\I18n\Google\Core\Translator; $translator = new Translator(); $translator->setup(['auth_key' => 'your-auth-key']); $result = $translator->translate(['Hello world!'], 'en', 'it'); // $result is an array, i.e ['translation' => ['Ciao mondo!']]