Download the PHP package babymarkt/deepl-php-lib without Composer

On this page you can find all versions of the php package babymarkt/deepl-php-lib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package deepl-php-lib

deepl-php-lib


Deprecated Library !

Hello everyone,

in the last couple of months we didn't give much attention to this projekt. DeepL on the other hand has developed client libraries for Python, .NET and Node.js (see: API-Doc).

Since there is a PHP-Library in the works Github and our track record with maintaining our library hasn't been as good as it should have been, we decided to abandon this library and switch internally to the official one.

To make clear that we won't continue to work on this repository, we will archive it. If anyone from the community wants to continue our work we can put a line in the README to point to the new maintained repository.

Otherwise, we recommend you to check out the new library coming from DeepL.

Thank you to everyone who contributed to this project over the years.


Latest Version on Packagist Build Status Coverage Status Quality Score Total Downloads

Simple PHP Library for DeepL API. You can translate one or multiple text strings (up to 50) per request.

🇩🇪🇦🇹🇨🇭🇬🇧🇺🇸🇪🇸🇲🇽🇫🇷🇮🇹🇯🇵🇳🇱🇵🇱🇵🇹🇧🇷🇷🇺🇨🇳🇬🇷🇩🇰🇨🇿🇪🇪🇫🇮🇭🇺🇱🇹🇱🇻🇷🇴🇷🇸🇸🇰🇸🇪

Official DeepL API

CHANGELOG

Install

Use composer if you want to use this library in your project.

Usage

Create an instance with your auth key:

Use the DeepL API Pro:

Translate

Translate one Text:

Translate multiple Texts:

param Description
$text Text to be translated. Only UTF8-encoded plain text is supported. The parameter may be specified as an Array and translations are returned in the same order as they are requested. Each of the array values may contain multiple sentences. Up to 50 texts can be sent for translation in one request.
$sourceLang Language of the text to be translated.
default: "" (DeepL will auto-detect)
$targetLang The language into which the text should be translated.
default: en
$tagHandling Sets which kind of tags should be handled. Options currently available: "xml"
$ignoreTags Array of XML tags that indicate text not to be translated.
default: null
$formality Sets whether the translated text should lean towards formal or informal language. This feature currently works for all target languages except "EN" (English), "EN-GB" (British English), "EN-US" (American English), "ES" (Spanish), "JA" (Japanese) and "ZH" (Chinese).

Possible options are:
"default" (default)
"more" - for a more formal language
"less" - for a more informal language
$splitSentences Array of XML tags which always cause splits
default: null
$preserveFormatting Sets whether the translation engine should respect the original formatting, even if it would usually correct some aspects. Possible values are:
"0" (default)
"1"
The formatting aspects affected by this setting include:
Punctuation at the beginning and end of the sentence
Upper/lower case at the beginning of the sentence
$nonSplittingTags Comma-separated list of XML tags which never split sentences.
default: null
$outlineDetection See: https://www.deepl.com/docs-api/handling-xml/outline-detection/
default: 1
$splittingTags Array of XML tags which always cause splits.
default: null

Supported languages

In Version 2 we removed the internal List of supported Languages. Instead, you can now get an array with the supported Languages directly form DeepL:

You can check for the supported Source-Languages:

Check for the supported Target-Languages:

Monitoring usage

You can now check how much you translate, as well as the limit:

Glossary

Create a glossary

param Description
$name Glossary name
$entries Array of entries
$sourceLanguage The source language into which the glossary rule apply
$targetLanguage The target language into which the glossary rule apply

Delete a glossary

param Description
$glossaryId Glossary uuid (set by DeepL when glossary is created)

List glossaries

Get glossary meta information: creation date, is glossary ready to use ...

param Description
$glossaryId Glossary uuid (set by DeepL when glossary is created)

Get glossary entries

param Description
$glossaryId Glossary uuid (set by DeepL when glossary is created)

Configuring cURL requests

If you need to use a proxy, you can configure the underlying curl client to use one. You can also specify a timeout to avoid waiting for several minutes if Deepl is unreachable

Testing

Run PHP_CodeSniffer Tests:

Run PHPMD Tests:

Run PHPUnit Tests:

Run all tests:

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of deepl-php-lib with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3 <8.2
ext-json Version *
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package babymarkt/deepl-php-lib contains the following files

Loading the files please wait ....