Problem/Motivation

DeepL introduced an official PHP client library for the DeepL API a few month ago.
Our current approach is using the REST API directly and doesn't take advantage of the API client, which is really handy for developers.

Proposed resolution

  • remove old REST API based code and switch to PHP client library while requesting translations
  • add new deepl_api translator plugin, which deprecates the old deepl_pro and deepl_free translator plugins (no longer needed)
  • rewrite tests to fit new approach - we no longer need to build custom endpoints and only create a mock for the requestTranslation / get Usage method of DeeplTranslator

Further information

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

SteffenR created an issue. See original summary.

steffenr’s picture

Issue summary: View changes
steffenr’s picture

Assigned: steffenr » Unassigned
Issue summary: View changes
steffenr’s picture

Version: 2.1.x-dev » 2.2.x-dev
steffenr’s picture

Assigned: Unassigned » steffenr

SteffenR changed the visibility of the branch 2.1.x to hidden.

SteffenR changed the visibility of the branch 2.2.x to hidden.

SteffenR changed the visibility of the branch 3324073-official-php-library to hidden.

steffenr’s picture

Issue summary: View changes

idebr’s picture

@steffenr The merge request seems pretty complete. Is there anything that needs to be changed before a merge? The official PHP client would be very welcome when working on #3494249: Support translation of documents

steffenr’s picture

@idebr
Actually i wanted to complete the test coverage of the code.
But at the moment I don't have the time to complete this, as writing the tests takes up more time.

From my point of view, it's possible to create a 2.3.x development release, that you can use as a starting point for your work on #3494249: Support translation of documents.
What do you think?

idebr’s picture

Sure, that makes sense. Can completing the test coverage be done in a follow-up issue in 2.3.x?

steffenr’s picture

Yep - that's not a problem.

I just had the plan to build up a fully tested release. But as always it's about time ;)

  • steffenr committed cfcb71a5 on 2.3.x
    #3324073: Use official PHP client library for the DeepL API
    
steffenr’s picture

Version: 2.2.x-dev » 2.3.x-dev
Status: Active » Fixed

  • steffenr committed a8a214a1 on 2.3.x
    #3324073: improve exception handling in DeeplTranslatorApi->...

  • steffenr committed 9e78140d on 2.3.x
    #3324073: fix php code quality issues in DeeplTranslatorApi
    

  • steffenr committed 6a4af89c on 2.3.x
    #3324073: fix php code quality issues in DeeplGlossaryForm
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.