Skip to content

bedita/i18n-google

Repository files navigation

BEdita I18n Google plugin

Github Actions codecov phpstan Scrutinizer Code Quality image image

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 >= 7.4.

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!']]