Problem/Motivation
As the maintainer of the tmgmt_deepl module and we (as company undpaul) want to take part in the new DeepL Partner programme. Therefore the User-Agent header needs to be changed.
To meet the programme’s requirement, a specific static partner-identifier value must be sent:
deepl-partner-integration-undpaul
We want to implement this in a way that is backward-compatible and gives users the ability to opt-out (i.e., disable the partner ID) via a simple checkbox.
Proposed resolution
- add a new checkbox in the translator configuration form (DeepL translator settings in TMGMT) labelled for “Do not send the DeepL Partner ID in API requests.”.
- This checkbox defaults to be unchecked (i.e., sending the partner ID by default).
- If the user checks the box, the module falls back to the original header value
tmgmt_deepl.
User interface changes
- Checkbox Do not send the DeepL Partner ID in API requests. is availabel in translation settings
- Description: If this option is enabled, the module will not send the partner identifier
deepl-partner-integration-undpaulin each DeepL API request.
Issue fork tmgmt_deepl-3554544
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
Comment #3
steffenrComment #4
steffenrComment #5
steffenrComment #6
steffenrThe application to the partner program has been approved. The MR will be merged and a new release will be created.
Comment #8
idebr commentedWhy default installations to deepl-partner-integration-undpaul?
Comment #9
steffenrComment #10
steffenr@idebr: Passing a partner id was part of the requirement to get enrolled in the partner program. For reasons of transparency i've added a note to the module page telling about the new header value. The setting can be easily disabled within the translator plugin settings.
Further info
In order to track and attribute usage of the integration, the integration partner must include the following identifier in the user agent of all DeepL API requests made by the integration.
We spoke to a representative of DeepL because we were unsure of how to solve this in an open-source project such as Drupal, and they asked us to add it as an opt-out.
Comment #11
steffenrComment #13
idebr commentedThen perhaps make partner id a string in the configuration object? It doesn't make a lot of sense outside on projects managed outside undpaul