Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bedita/i18n-microsoft
https://github.com/bedita/i18n-microsoft
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bedita/i18n-microsoft
- Owner: bedita
- License: lgpl-3.0
- Created: 2023-11-13T13:41:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-17T11:47:22.000Z (8 months ago)
- Last Synced: 2024-11-29T16:53:54.314Z (24 days ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.LGPL
Awesome Lists containing this project
README
# BEdita I18n Microsoft plugin
[![Github Actions](https://github.com/bedita/i18n-microsoft/workflows/php/badge.svg)](https://github.com/bedita/i18n-microsoft/actions?query=workflow%3Aphp)
[![codecov](https://codecov.io/gh/bedita/i18n-microsoft/branch/main/graph/badge.svg)](https://codecov.io/gh/bedita/i18n-microsoft)
[![phpstan](https://img.shields.io/badge/PHPStan-level%205-brightgreen.svg)](https://phpstan.org)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bedita/i18n-microsoft/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/bedita/i18n-microsoft/?branch=main)
[![image](https://img.shields.io/packagist/v/bedita/i18n-microsoft.svg?label=stable)](https://packagist.org/packages/bedita/i18n-microsoft)
[![image](https://img.shields.io/github/license/bedita/i18n-microsoft.svg)](https://github.com/bedita/i18n-microsoft/blob/main/LICENSE.LGPL)## Installation
You can install this plugin into your application using [composer](https://getcomposer.org).
The recommended way to install composer packages is:
```
composer require bedita/i18n-microsoft
```Note: php version supported is >= 7.4.
## Microsoft Translator TEXT API
This plugin uses [Microsoft Translator TEXT API](https://www.microsoft.com/en-us/translator/business/translator-api/) to translate texts.
Usage example:
```php
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!']]
```