bedita/i18n-microsoft

BEdita I18n Microsoft plugin supporting PHP >= 8.3

v1.1.0 2024-12-06 14:20 UTC

README

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-microsoft

Note: php version supported is >= 8.3.

Microsoft Translator TEXT API

This plugin uses Microsoft Translator TEXT API to translate texts.

Usage example:

use BEdita\I18n\Microsoft\Core\Translator;

$translator = new Translator();
$translator->setup([
    'auth_key' => 'your-auth-key', // Microsoft Translator KEY 1
    'location' => 'your-location', // Microsoft Translator Location/Region i.e. westeurope
]);
$result = $translator->translate(['Hello world!'], 'en', 'it');
// $result is an array, i.e ['translation' => ['Ciao mondo!']]