-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readme, minor changes in methods add GA badge
- Loading branch information
Showing
5 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# DeepL API wrapper for PHP | ||
|
||
![example workflow](https://github.com/haltuf/deepl-php-api/actions/workflows/ci.yml/badge.svg) | ||
|
||
Unofficial, no-dependency library for calling DeepL API. | ||
Requires curl extension. Supports PHP >= 7.1, works for PHP 8.0, too. | ||
|
||
Currently Work-In_progress. Works for basic use cases, no support for xml parameters yet. | ||
|
||
## Installation | ||
|
||
``` | ||
composer require haltuf/deepl-php-api | ||
``` | ||
|
||
## Usage | ||
|
||
Create `Api` object and call `translate` method. | ||
|
||
```php | ||
use Haltuf\DeepL\Api; | ||
use Haltuf\DeepL\Language; | ||
|
||
$api = new Api('my_key'); | ||
$translation = $api->translate('Text to be translated', Language::CZECH, Language::ENGLISH); | ||
|
||
echo $translation->getText(); | ||
``` | ||
|
||
Outputs: `Text, který má být přeložen` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters