Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bedita/i18n-deepl
DeepL translator plugin
https://github.com/bedita/i18n-deepl
Last synced: about 1 month ago
JSON representation
DeepL translator plugin
- Host: GitHub
- URL: https://github.com/bedita/i18n-deepl
- Owner: bedita
- License: lgpl-3.0
- Created: 2023-11-03T08:41:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-14T09:34:52.000Z (about 1 year ago)
- Last Synced: 2024-04-10T18:11:25.124Z (9 months ago)
- Language: PHP
- Size: 23.4 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.LGPL
Awesome Lists containing this project
README
# BEdita I18n Deepl plugin
[![Github Actions](https://github.com/bedita/i18n-deepl/workflows/php/badge.svg)](https://github.com/bedita/i18n-deepl/actions?query=workflow%3Aphp)
[![codecov](https://codecov.io/gh/bedita/i18n-deepl/branch/main/graph/badge.svg)](https://codecov.io/gh/bedita/i18n-deepl)
[![phpstan](https://img.shields.io/badge/PHPStan-level%205-brightgreen.svg)](https://phpstan.org)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bedita/i18n-deepl/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/bedita/i18n-deepl/?branch=main)
[![image](https://img.shields.io/packagist/v/bedita/i18n-deepl.svg?label=stable)](https://packagist.org/packages/bedita/i18n-deepl)
[![image](https://img.shields.io/github/license/bedita/i18n-deepl.svg)](https://github.com/bedita/i18n-deepl/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-deepl
```Note: php version supported is >= 7.4.
## DeepL Translator
This plugin uses [DeepL Translator](https://www.deepl.com/translator) to translate texts, via [deepl-php](https://github.com/DeepLcom/deepl-php).
Usage example:
```php
use BEdita\I18n\Deepl\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!']]
```