deeplcom/deepl-php
Official PHP client for the DeepL API. Translate text and documents with simple methods like translateText(), using your DeepL authentication key. Composer install, supports PHP 7.3+ with ongoing updates as the API evolves.
DeepLClient class:
createStyleRule(), getStyleRule(), updateStyleRuleName(),
updateStyleRuleConfiguredRules(), and deleteStyleRule().DeepLClient class: createStyleRuleCustomInstruction(),
getStyleRuleCustomInstruction(), updateStyleRuleCustomInstruction(),
and deleteStyleRuleCustomInstruction().
Please refer to the README for usage instructions.testModelType() to just check if the model_type_used is populated if the model_type is specified in the requesttestMixedDirectionText() to add a missing </p> tagNotFoundException error message by removing the misleading "check server_url" suggestion.curl_close call for PHP 8+.tag_handling_version parameter to translateText() specify which version of the tag handling algorithm to use. Options are v1 and v2.custom_instructions parameter to translateText() to customize translation
behavior with up to 10 instructions (max 300 characters each). Only supported for
target languages: de, en, es, fr, it, ja, ko, zh and their variants.
Note: using the custom_instructions parameter will use the quality_optimized
model type as the default. Requests combining custom_instructions and the
latency_optimized model type will be rejected.GET /v3/style_rules endpoint in the client library, the
implementation can be found in the DeepLClient class. Please refer to the
README for usage instructionsstyle_id option to translateText() which allows text translation with
style rules.StyleRuleInfo, ConfiguredRules, and CustomInstruction
to support style rules functionality.extraRequestParameters option to text and document translation methods to pass arbitrary parameters in the request body. This can be used to access beta features or override built-in parameters (such as target_lang, source_lang, etc.).DeepLClientOptions wrongly inheriting from TranslateTextOptions,
when it should be TranslatorOptions.
DeepLClient class. Please refer to the README for usage
instructions.DeepLClient
class. Please change your code to use this over the Translator class whenever
convenient.TextResult constructor to be compatible with pre-1.10 versions, to
facilitate mocking
php_uname.
MODEL_TYPE option to translateText() to use models with higher
translation quality (available for some language pairs), or better latency.
Options are 'quality_optimized', 'latency_optimized', and 'prefer_quality_optimized'$modelTypeUsed field to translateText() response, that
indicates the translation model used when the MODEL_TYPE option is
specified.$billedCharacters to the translate text response.docx or pptx files. For more info check the README.VERSION values to 1.7.1New language available: Arabic ('ar'). Add language code constants and tests.
Arabic is currently supported only for text translation; document translation
support for Arabic is coming soon.
Note: older library versions also support the new language, this update only adds new code constants.
translateText function in Translator
context parameter for text translation, that specifies
additional context to influence translations, that is not translated itself..gitattributes file to exclude irrelevant files from package download.
Translator object, in order to configure timeouts, security features etc more granularly.
New languages available: Korean ('ko') and Norwegian (bokmål) ('nb'). Add language code constants and tests.
Note: older library versions also support the new languages, this update only adds new code constants.
psr/log. As this package forms a PHP Standard
Recommendation, we don't consider it to break backward-compatibility.'prefer_less' and 'prefer_more'.503 Service Unavailable errors are now retried.
Attempting to download a document before translation is completed will now
wait and retry (up to 5 times by default), rather than throwing an exception.Stable release.
Add glossary management support.
New language available: Ukrainian ('uk'). Add language code constant and tests.
Note: older library versions also support new languages, this update only adds new code constant.
Add proxy support.
New languages available: Indonesian ('id') and Turkish ('tr'). Add language code constants and tests.
Note: older library versions also support the new languages, this update only adds new code constants.
final keyword from class declarations to facilitate testing.server_url option.Initial version.
How can I help you explore Laravel packages today?