Giter Site home page Giter Site logo

deeplcom / deepl-php Goto Github PK

View Code? Open in Web Editor NEW
181.0 13.0 23.0 163 KB

Official PHP library for the DeepL language translation API.

License: MIT License

PHP 99.59% Dockerfile 0.17% Shell 0.24%
api deepl language php translation translator official i18n

deepl-php's Issues

Question about keys in translated arrays

Why does the translation function not retain the key, when translating an array of text?

$to_translate = array('a' => 'Text A', 'b' => 'Text B');
$translations = $translator->translateText($to_translate, 'en-US', 'de');

The result is return as an array indexed 0, 1 rather than indexed using 'a', 'b'. Is there a reason for this behavior?

Use glossary for target language en-GB

QUEST:
With which parameters do I have to create a glossary for DE->EN so that I can use it for translation?


When creating a glossary, the target language is changed from "en-GB" to "en".
Translator.php::331
This means that it is only possible to create a glossary for e.g. "de"->"en".


When using Translator::translateText for the target language "en"
you get an error message:
Fatal error: Uncaught DeepL\DeepLException: targetLang="en" is deprecated, please use "en-GB".

Therefore, you must use Translator::translateText with "en-GB".
This will give results when using WITHOUT glossary.

When using the previously created glossary with target language "en"
the library sends these post parameters to the API:
target_lang=en-GB&source_lang=en&formality=prefer_more&glossary_id=500ebda5-50b5-4e6b-ae0e-b8d64bcf57b3&text=Example+Sentence&tag_handling=html
you get the error message:
{"message": "Language pair of the glossary doesn't match the language pair of the request"}

Encode/decode the results for italian and other languages?

Hi there!

I see when i try to translate the result is wrong some times.

I wonder if there is some encode/decode integrated function to prevent those texts with special caracteres?

Ej: áéú etc?

Or shold i just use usual php functions?

Thank you!

Feature request: Make it possible to retrieve billing period for usage

This probably requires an API change as well.

I would like to know to what time frame the "usage" applies to. I have count used and a limit (for characters, document and team documents). I assume it applies to current billing period, which is in our case monthly but the start of the time interval may vary (for example in our case it is February 26, 2023 - March 25, 2023). So you cannot assume the month starts with day 1, e.g. February 1.

For example this is the output I would like to display:

characters:
20% used (February 26, 2023 - March 25, 2023)

I can use the timeframe as fixed string in my case, but if people want to supply further PHP packages based on this API for public use, it would be helpful to be able to read this from the API.

My wish would be to extend the Usage information fetched from the DeepL API and Usage class in deepl-php.

https://www.deepl.com/docs-api/general/get-usage/

Error while instaling: Your requirements could not be resolved to an installable set of packages.

Hi, I received that error while installing:

miguel@miguel-IdeaPad-3-15ITL6:/var/www/html/vmo$ composer require deeplcom/deepl-php
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^0.4.0 for deeplcom/deepl-php
./composer.json has been updated
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package vendor/package could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package vendor/package2 could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package vendor/package3 could not be found in any version, there may be a typo in the package name.
  Problem 4
    - pelago/emogrifier v2.2.0 requires php ^5.5.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.3) does not satisfy that requirement.
    - pelago/emogrifier v2.2.0 requires php ^5.5.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.3) does not satisfy that requirement.
    - Installation request for pelago/emogrifier (installed at v2.2.0) -> satisfiable by pelago/emogrifier[v2.2.0].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.
miguel@miguel-IdeaPad-3-15ITL6:/var/www/html/vmo$

Any solution please?

Thank you,
Miguel

Wrong behavior with TranslateTextOptions::TAG_HANDLING xml and notranslate tag

Hi @daniel-jones-deepl,

I discover another bug with the TranslateTextOptions::TAG_HANDLING => xml (But different from #43 (comment))

Translating FR to ES

En seulement 4 mois, l’établissement a généré <strong wg-1="">30k€ de <notranslate>ingresos</notranslate></strong> et a enregistré <strong wg-2="">plus de 80 nouvelles réservations</strong> suite à l’envoi d’e-mails marketing personnalisés

En sólo 4 meses, el establecimiento generó <strong wg-1="">30k€ en <notranslate>ingresos</notranslate></strong> y registró <strong wg-2="">más de 80 nuevas reservas</strong> tras el envío de emails de marketing personalizados.

Translating FR to ES with TranslateTextOptions::TAG_HANDLING => xml

En seulement 4 mois, l’établissement a généré <strong wg-1="">30k€ de <notranslate>ingresos</notranslate></strong> et a enregistré <strong wg-2="">plus de 80 nouvelles réservations</strong> suite à l’envoi d’e-mails marketing personnalisés

<strong wg-1=""> <notranslate>ingresos</notranslate>En sólo 4 meses, el establecimiento generó</strong> <strong wg-1="">30.000 euros</strong> y registró <strong wg-1=""></strong> <strong wg-2="">más de 80 nuevas reservas</strong> tras el envío de correos electrónicos de marketing personalizados.

I would expect a result similar to the first one.

Could you confirm and forward the issue to your backend team ? Thanks.

Version 1.5.0 should be considered a breaking change?

Per, issue #27 DeepL PHP library now requires devs to add

require __DIR__ . '/../vendor/autoload.php';

prior to instantiating the translator.

In my composer.json, I had my constraints set to allow upgrades to non-breaking versions. However, because of this additional step, the DeepL library triggered fatal errors after a running composer install on a deployment.

However when v1.4.0 is installed and running composer outdated, it denotes v 1.5.0 only contains bug fixes. I disagree considering it will likely break the apps of people coming from v.1.5.0.

Anyhow thought I'd give you a heads up in case this was an oversight.

Also, the fix in the issue above should be mentioned in the docs, right?

QUESTION: Question/Issue regarding translation speed for Tweet-sized sentences

I am currently benchmarking DeepL against Google Translate for translating photo captions the size of a Tweet with a rather standardized sentence structure from English to German and French. 80% of the translated caption phrases are identical and in the last 20%, DeepL chooses a more appropriate vocabulary, e.g.

ORIGINAL: Belinda Bencic of Switzerland plays the ball during her third round match against Donna Vekic of Croatia on day two of the 2019 French Open at the Roland Garros stadium in Paris, France on May 31, 2019 (Photo by Claude Diderich / freshfocus)
DEEPL TRANSLATION:  PARIS, FRANKREICH - 31. MAI: Belinda Bencic aus der Schweiz spielt den Ball während ihres Drittrundenmatches gegen Donna Vekic aus Kroatien am zweiten Tag der French Open 2019 im Roland-Garros-Stadion in Paris, Frankreich am 31. Mai 2019 (Foto: Claude Diderich / freshfocus)
GOOGLE TRANSLATION: PARIS, FRANKREICH - 31. MAI: Belinda Bencic aus der Schweiz spielt den Ball während ihres Spiels in der dritten Runde gegen Donna Vekic aus Kroatien am zweiten Tag der French Open 2019 im Roland Garros-Stadion in Paris, Frankreich, am 31. Mai 2019 (Foto von Claude Diderich / freshfocus)

But I noticed that on the speed/latency side, Google is 2x to 3x faster (0.15s vs 0.31s, 0.13s vs 0.39s, 0.2s vs 0.52s, etc.). I was wondering if that is due to

  1. the fact that I am currently using the free version from DeepL, i.e., the paid version would be much faster, or
  2. the translation at deepl.com taking more time than Google does, due to the complexity of the translation algorithm used, i.e., it's coming from the software side, or
  3. deepl.com having less sophisticated hardware resources in place, i.e., it's coming from the hardware side, or
  4. me being located in Switzerland and my network connection to translate.google.com is faster than to deepl.com?

When passing in WP $content variable, translate_text emits a type errror

I am working on adding DeepL API to my organization's Wordpress site.

Right now, I have a hook that gets the content of blogs, pages and posts that has already been converted to HTML and translates it using the DeepL PHP library. It works great most of the time. However, whenever the post content includes content from a secondary query that retrieves featured posts, I get the following error:

 Uncaught Exception: texts parameter must be a non-empty string or array of non-empty strings 

However, when I check the type of the content variable and its length, it is confirmed to be a string. I checked the function in Translator.php to see what it's checking for and it's simply checking to see if the text argument is indeed a string AND is not empty.

Here's my code:

add_filter('the_content', function($content){
        if(in_the_loop()){
            $deepl_api_key = $_SERVER['DEEPL_API_KEY'];
            $translator = new \DeepL\Translator($deepl_api_key);
            $content_translated = $translator->translateText($content, 'EN', 'ES', ['tag_handling' => 'html'] );
            return $content_translated;
        }
        return $content;
  }, 99);

Here's the full error being emitted

Fatal error: Uncaught Exception: texts parameter must be a non-empty string or array of non-empty strings (View: /srv/www/site.com/current/web/app/themes/theme/resources/views/blocks/featured-posts.blade.php) (View: /srv/www/site.com/current/web/app/themes/theme/resources/views/blocks/featured-posts.blade.php)
in /srv/www/site.com/current/vendor/deeplcom/deepl-php/src/Translator.php on line 558


I am somewhat grasping at straws for what is causing this issue and am aware this could be an issue with WP Core or our custom theme. However, I figured I might as well place the issue here in case it is a DeepL PHP library issue. 

Problems with "final class Translator in phpunit integration Tests

Hey,
at the moment I try to replace https://github.com/Baby-Markt/deepl-php-lib with your Library.
Everything went relatively smooth but I ran into an Issues when it comes to user the Library in integration Tests.
Since I am not able to start an API-Mock-Server during our Tests, I want to Mock your Translator class and to manipulate the return value of for example the translateText-Method. At the moment this is not possible because the Translator-Class is final and phpunit uses Class-Extension to create Mockclasses.
I tried Mockery but since we use type hinting this fails too.

Is it possible for you to Change the definition or do you have an other suggestion for this Problem?

Word not found

Hi, as far as I know, when a word is not found, DeepL will try to guess or just return the same entry.
Is it possible to know when that happens? or to have the option to avoid it altogether? sometimes it's better to get a 'not found' message/error than a wild guess due to a misspelling.
Thank you for this, by the way, it's very useful!
Andres

Progress bar for DeepL PHP API

Hello,

I've implemented a progress bar for uploading and translating documents using the DeepL PHP API.
I use Javascript Fetch(), $translator->uploadDocument() and $translator->waitUntilDocumentTranslationComplete($document_handle)

The current documentation isn't very detailed, so I'd like to send you a pull-request,
which would add an examples directory and the example usage file with progress bar.

I thought it might help other users; if you're interested, please let me know.

Missing in the PHP library the parameter "output_format" ("docx" for translating a PDF file into a Word document)

Missing in the PHP DeepL library the parameter "output_format" ("docx" for translating a PDF file into a Word document).

output_format
type of string: File extension of desired format of translated file, for example: docx.
If unspecified, by default the translated file will be in the same format as the input file.

This option is supported by the DeepL API Pro interface but seems to not be yet implemented in some DeepL libraries (PHP, .NET, ...).

I would be very pleased if you could add this feature in this library.

Thank you verys much in advance for your efforts.

Best regards
Régis Barbier

Usage API may not return limit

Currently, the API is only returning the character_count and not the character_limit:

11:31:06 INFO      [app] DeepL API response POST https://api.deepl.com/v2/usage 200
11:31:06 DEBUG     [app] Response details: {"character_count":151629018}

In my use case, we only need to have the character_count, but the implementation discards the response if both are not present:

 private function buildUsageDetail(string $prefix, array $json): ?UsageDetail
    {
        $count = "{$prefix}_count";
        $limit = "{$prefix}_limit";
        if (array_key_exists($count, $json) && array_key_exists($limit, $json)) {
            return new UsageDetail($json[$count], $json[$limit]);
        }
        return null;
    }

BUG: Class Http\Discovery\Psr17FactoryDiscovery not found error

After updating the package deeplcom/deepl-php to the latest version [1.5.0 according to VERSION] by running composer update today (27.06.2023) and having to add the pugin php-http/discovery to my allow-plugins list, I receive the following error message:

[27-Jun-2023 10:03:06 Europe/Zurich] PHP Fatal error:  Uncaught Error: Class "Http\Discovery\Psr17FactoryDiscovery" not found in /photos/holiday/vendor/deeplcom/deepl-php/src/HttpClientWrapper.php:66
Stack trace:
#0 /photos/holiday/vendor/deeplcom/deepl-php/src/Translator.php(75): DeepL\HttpClientWrapper->__construct()
#1 /photos/holiday/lib3/class.Translate.php(26): DeepL\Translator->__construct()
#2 /photos/holiday/web3/holiday.php(47): Translate->__construct()
#3 {main}
  thrown in /photos/holiday/vendor/deeplcom/deepl-php/src/HttpClientWrapper.php on line 66

Cannot create account / API key

Hi, the following appears on your site when you sign up -- only after providing a credit card...

image

I actually tried again with a new account and got the same thing. Doesn't seem to be a way to generate API keys right now. I did contact support, but have not heard anything.

Call to undefined function DeepL\curl_version() in deeplcom\deepl-php\src\Translator.php:738

I tried to change the http-client like shown in the README section - Custom HTTP client.

What results in Error:

 Call to undefined function DeepL\curl_version() in deeplcom\deepl-php\src\Translator.php:738

Here is my code to find this error:

$client = new \GuzzleHttp\Client([
    'handler' => new \GuzzleHttp\Handler\StreamHandler()
]);

$translator = new \DeepL\Translator($authKey);
$translator->translateText($text, $source, $target, [
    TranslatorOptions::HTTP_CLIENT => $client
]);

So it seems that even when you chance the HttpClient, the Translator Class still tries to use method/functions related to Curl HttpClient for building the user-agend string.

Suggestion to fix:

  1. check which Guzzle handler is used
  2. Only is a handler is used, that extends CurlHandler, set $libraryInfoStr to " curl/$curlVer"
  3. for other Handler, either don`t add this info, or find a way to get similar infos from the other Handler classes

instaling libreries without composer

Hi. I have problem with composer and deepl libraries.

It is posible to install without composer ?

Where are the files and a simple example in php for translate deepl using a frre api

best regards

targetLang="en" is deprecated, please use "en-GB" or "en-US" instead

Execute scheduled task: Autotranslation Fetch (filter_autotranslate\task\autotranslate_task)
... started 22:06:02. Current memory use 29.1 MB.
Debugging increased temporarily due to faildelay of 60
Executing autotranslation fetch jobs...
200 jobs found...
fetching en translation for d41d8cd98f00b204e9800998ecf8427e key...
... used 4 dbqueries
... used 0.015782117843628 seconds
Scheduled task failed: Autotranslation Fetch (filter_autotranslate\task\autotranslate_task),targetLang="en" is deprecated, please use "en-GB" or "en-US" instead.
Backtrace:
* line 156 of /filter/autotranslate/vendor/deeplcom/deepl-php/src/Translator.php: call to DeepL\Translator->buildBodyParams()
* line 108 of /filter/autotranslate/classes/task/autotranslate_task.php: call to DeepL\Translator->translateText()
* line 405 of /lib/classes/cron.php: call to filter_autotranslate\task\autotranslate_task->execute()
* line 208 of /lib/classes/cron.php: call to core\cron::run_inner_scheduled_task()
* line 125 of /lib/classes/cron.php: call to core\cron::run_scheduled_tasks()
* line 186 of /admin/cli/cron.php: call to core\cron::run_main_process()

This isn't technically a bug but it broke our entire app. The Readme might need updated to notify users of this. We have a custom plugin on Moodle that's based entirely on 2 letter locale codes and I haven't gotten into the internals yet to see if it will give us the en-US format. There might be other software out there that suffers from the same problem.

Adding curl-options

Hi,
is there a way to add curl-options when instantiating the Translator?
I need to include verify_peer: false and verify_host: false, otherwise I'll get a "SSL certificate error: unable to get local issuer certificate"-exception.

I have tried
$translator = new \DeepL\Translator('KEY', ['headers' => ['verify_peer' => false, 'verify_host' => false]]);
but that doesn't work (same with "0" instead of "false" for both options).
I see the options getting added to $curlOptions in HttpClient (line 182), but they don't seem to do anything.

Thanks

FEATURE REQUEST: Add support for changing httpClient

Currently you are using a static internal http client based on curl. It would be good if there would be an option to set an alternative http client (e.g. guzzlephp, php streams or any psr18 compatible client).

This would be usefull e.g. when you can`t use curl, or when you are using any framework with its own httpclient.

I would suggest to add a new option to the options array e.g.

  $translator = new \DeepL\Translator($authKey);
  $translator->translateText($text, $source, $target, [
      'httpClient' => new Psr18Client()
  ]);

The option httpClient should accept any client matching to an from predefined defined "HttpClientInterface" and you change your code to only use HttpClientInterface to be compatible with all comming implementations on this interface.

Benefit would be, you only need to implement the basic logic of passing new clients based on this interface, createing different clients could be done by the community.

examples how this could be done can be found in other projects using changeable http clients like here

EDIT:
This feature would automatically resolve #14 because you could ad or change an alternative curl client with custom config.

Problems with POST request with getUsage (400 status code - bad request)

I had some problems using this client library. Specifically, the Translator::getUsage() call worked on a development system, but not on other machine (with the same software package). Everything else worked very reliably.

The problem that occurs is that the getUsage request returns 400 HTTP status code (bad request).

I can reproduce this consistently, I even created a small test script with (basically) the same code.

After some tests I could narrow it down:

All systems use

  • deeplcom/deepl v1.3.0
  • PHP 7.4 or 8.1

Always worked:

  • Translator::listGlossaries()
  • Translator::getGlossaryEntries()
  • Translator::createGlossary()

Problems on some machines:

  • Translator::getUsage()

The problems occured on:

  • RHEL systems with PHP 8 and PHP 7 (curl 7.29.0)

Ok:

  • Ubuntu with PHP 8 (curl 7.81.0)

Suspected problem

  • some differences between systems in cURL library / PHP settings (the configuration and usage of deeplcom/deepl was identical)
  • getUsage is the only call that uses POST request, not GET
  • with POST, the Content-Type header is not set and also CURLOPT_POSTFIELDS is not set. I assume that my different cURL libs handle that differently.

Resproduce

It is a little difficult to reproduce because the problem does not manifest itself on all systems and I am not sure what is the relevant setting.

Possible solution

Ideally, figure out exact reason why server sends 404. However, this also seems to fix the problem:

  1. Either use GET with getUsage. I am not sure why POST is used, the API docs use GET: https://www.deepl.com/docs-api/general/get-usage/
  2. or

in HttpClient::sendRequest

$headers['Content-Type'] = 'application/json';
$payload = json_encode( [] );
$curlOptions[\CURLOPT_POSTFIELDS] = $payload;

Additional information

I activated logging and also have a test script which reproduces the problem on the affected machines and outputs some more information. I can upload the logs if requested.

The test script is here: https://github.com/sypets/sypets_test_deepl_usage_standalone

413 Request Entity Too Large

I am trying to translate 1009 lines of text (312 KiB) in a single POST request via a WordPress plugin I created and can't due to a generic internal server error (HTTP 500). After inspecting the logs, I found this client error:

PHP Fatal error:  Uncaught DeepL\DeepLException: Unexpected status code: 413 , <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>
, content: <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>

I've done some brief research, to find that the maximum possible size of a POST request is limited by the server, as well as the client by doing something like: min(serverMaxSize, clientMaxSize). Since it's a HTTP 4xx error, I presume the fault lies within the library/client here?

Here are some of my server settings (php.ini), which look fine to me:

Key Value Description
max_input_vars 1000 PHP max input variables
max_execution_time 30 PHP time limit
memory_limit 512M PHP memory limit
max_input_time 60 Max input time
upload_max_filesize 50M Upload max filesize
post_max_size 50M PHP post max size

Any ideas are greatly appreciated! Thanks for making this open source!

Autoloading not working

Hello,

I'm guessing this is not directly related to this library but I am experiencing some very strange behaviour and was hoping you could still help me.

I am working on a WordPress plugin with the following code:

<?php
/**
 * [...]
 */

namespace My\Namespace;

define( 'PLUGIN_FILEPATH', __FILE__ );
define( 'DEEPL_API_HOST', 'api-free.deepl.com' );
define( 'DEEPL_API_KEY', '[...]' );

require_once __DIR__ . '/vendor/autoload.php'; // composer's autoloader
require_once __DIR__ . '/src/autoload.php'; // my own autoloader for the plugin

$plugin = new Plugin( PLUGIN_FILEPATH );
$plugin->run();

require_once '/vendor/deeplcom/deepl-php/src/Translator.php'; // Required to avoid error
$translator      = new \Deepl\Translator(DEEPL_API_KEY);
$sourceLanguages = $translator->getSourceLanguages();

Without manually requiring the DeepL class I get the following error:

PHP Fatal error:  Uncaught Error: Class "Deepl\Translator" not found in /path/to/my/plugin/my-plugin.php:36
Stack trace:
#0 /path/to/wordpress/wp-settings.php(453): include_once()
#1 /path/to/wordpress/wp-config.php(96): require_once('C:\\laragon\\www\\...')
#2 /path/to/wordpress/wp-load.php(50): require_once('C:\\laragon\\www\\...')
#3 /path/to/wordpress/wp-admin\admin.php(34): require_once('C:\\laragon\\www\\...')
#4 {main}
  thrown in /path/to/my/plugin/my-plugin.php on line 36

Composer commands I have run in an attempt to fix this:

  • composer require deeplcom/deepl-php
  • composer install
  • composer dump-autoload

My composer.json:

{
    "require": {
        "deeplcom/deepl-php": "^1.4"
    }
}

I'm probably making an obvious mistake but can't see what. Please help!

Thanks in advance!

[Security] Actions due to/Information around CVE-2023-38545

The cURL project recently announced a high-severity security flaw affecting cURL and libcurl, with patches coming out on Oct 11th. DeepL takes security extremely seriously and is taking the appropriate internal measures to ensure the flaw is fixed in our systems ASAP. This issue serves to inform the users of our client libraries how this flaw affects the client libraries.

Affected libraries
We reviewed our dependencies and found no link to cURL in any library except this PHP one. This library uses the PHP cURL extension ext-curl, and does not itself include libcurl or similar. Hence, it is the user's responsibility to update the library on the system the client library is running on.

How can I check if I am affected?
Run this command in your console with the php binary that is also used for the client library. php -r "phpinfo(INFO_MODULES);" | grep cURL

If the cURL Information line shows a version below 8.4.0, you are affected and should update your system's cURL version.

How can I update?

This will depend on your operating system/how you installed cURL. You can find some general pointers for all major operating systems here.

Getting "syntax error, unexpected ')' in src/Translator.php" when constructing Translator

Docker php:7.4-fpm

I get a syntax error when calling:

$translator = new \DeepL\Translator($authKey);

and if you look into the file deepl-php/src/Translator.php at Line 552 and Line 559 shown as below:

// Line 552, validateAndAppendTexts()
throw new DeepLException(
    'texts parameter must be a non-empty string or array of non-empty strings',
);

// Same as above, Line 559, validateAndAppendTexts()
throw new DeepLException(
    'texts parameter must be a non-empty string or array of non-empty strings',
);

Remove the comma right after the message will fix it :

throw new DeepLException(
    'texts parameter must be a non-empty string or array of non-empty strings'
);

Just in case anyone has the same issue, so I posted it here :)

ErrorMessage -> too many errors

When I translate a document pdf with a table using the glossary, I have this error message.

I would like to know what´s the error or how to fix it, could you help me?

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.