It would be useful to customize translations using the DeepL glossary feature.
The module uses the official PHP client library for the DeepL API under the hood, which supports setting a glossary for a translation request. Therefore, adding a named key called "glossary" to the options array will ensure that the client calls the endpoint correctly.
$options[TranslateTextOptions::GLOSSARY] = "11111111-2222-3333-4444-555555555555";
$translated = $this->getClient()->translateText($text, $sourceLanguage, $targetLanguage, $options);
I'm not sure if the DeepL API supports multiple glossaries per request. Looking at the documentation/code, I don't think it does.
Furthermore, it appears that they are in the process of transitioning from v2 to v3 of the API and changing from monolingual to multilingual glossaries.
There is no v3/translate endpoint in the client yet.
A simple implementation would be to allow users to add their glossary ID to the DeepLConfigForm and read/set it before calling the client, similar to how language variants are handled.
Let's start with a basic implementation and see what the future brings.
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.