DeepL Integration: Done

Issue #41 resolved
Andrea created an issue

Hi Anders,

once received the missing unit from you last week (amLocalization.Application.API.pas), I wrote a new provider unit for DeepL and I easily integrated it in your project with very limited effort (thanks to your design of the providers logic).

Tested successfully translating automatically BTM itself (from EN to IT).

I did also some minor changes:

  • Save + SaveAs buttons
  • Integrated the DeepL API Key configuration in the Settings window.

As I already said, my first objective is to use Better Translation Manager for myself.

I don't know Bitbucket and if I shoud create clones in this case, I just want to make this work available for others (I saw some request for DeepL integration), so let me know if you’re interested in what I did (I’m willing to share it with all of you) to embed it in your great development.

Thank you

Comments (11)

  1. Anders@Melander

    Good job!

    I would definitely be interested in getting your changes merged into the main repo. Do you have them on another Git server, such as Github or Gitlab?

    The best way to get it integrated would be to create a pull request but that requires that you’ve made a clone on Bitbucket and I can understand if you’re not too keen on that. It’s my plan to move to either Github or Gitlab but I’m a bit too busy at the moment and I also haven’t decided on which of the two it should be.

  2. Andrea reporter

    Hi Anders, I invited you to collaborate in my Github, currently in a private project.

    It is basically a clone of your last Butbucket project including my modifications and the new unit “Localization.Provider.DeepL.pas“.

    There is also the compiled version (executables) in the “bin” folder if you want to take a quick look at what I did.

    Please be aware that I’m new in using also in GitHub, this is the reason why I kept the project private...
    Look a that and let mw know how you want to proceed.

  3. Anders@Melander

    I have added two new branches with the changes from your repo:

    1. https://bitbucket.org/anders_melander/better-translation-manager/branch/DeepL
      Contains the DeepL provider.
      I had to reimplement the stuff in the settings dialog as it wasn’t possible to merge your changes - and I think I might have made an incorrect assumption here. I’ve assumed that it is only the Pro API that needs an API key. Can you confirm that this is incorrect and that an API key is required regardless of the license type?
    2. https://bitbucket.org/anders_melander/better-translation-manager/branch/Save_and_Save_as
      Contains the Save/Save As… changes. Rewritten from scratch.

    Once I get back from vacation I will do some more tests and merge the changes into the master branch.


    Btw, the way you should have made the changes was:

    1. Create a local Git clone of my repository.
    2. Push the repository to your GitHub (now you have an identical copy of my repo).
    3. Create a local branch and make your changes there. Only commit the relevant parts. Delphi makes lots of little irrelevant changes and you don’t want those to pollute your commits as they make it very hard to later integrate the changes.
    4. Push the branch to your GitHub repo.

    If you do it this way Git will maintain the link between the original files/commits in my repo and the new files/commits in your repo and it will be easy to have a Git client look at the two different repositories and identify and merge the differences.

  4. Andrea reporter

    Quick reply to your first question: yes, DeepL API key is required regardless the license type (Pro/Free).

    The setting of the license type (Pro/Free) is required because those versions uses different URLs to post the HTTPS request… in the “BeginLookup” they are set accordingly.

    I’m currently also on holidays, as soon as I’ll be back, I’ll follow your inputs on GitHub.

  5. Log in to comment