Use glossary feature

Created on 27 September 2025, 29 days ago
Updated 2 October 2025, 24 days ago

Problem/Motivation

It would be useful to customize translations using the DeepL glossary feature.

Use a glossary

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);

Considerations:

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.

Proposal:

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.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024