Glossaries are not considered when translating into target languages ​​with variants (e.g., EN-GB)

Created on 24 April 2025, about 10 hours ago

Problem/Motivation

In Deepl, glossaries with the target language EN can be used in translations with both English variants (EN-GB and EN-US). However, this doesn't work in the module: The translation service provider (/admin/tmgmt/translators) must be set to the target language EN for the glossary to be considered.

Steps to reproduce

1. Set the target language for the translation service provider (/admin/tmgmt/translators) to "English (british)"
2. Create a glossary (/admin/tmgmt/deepl_glossaries) and select "English" as the target language. In the Translator field, select your translation provider.
3. Now translate a piece of content with your translation service provider: The glossary is ignored. However, if you set the target language of the translation service provider to "English," the glossary will be considered.

Proposed resolution

I made the following changes to the function "getMatchingGlossaries".

      // 'source_lang' => $source_lang,
      // 'target_lang' => $target_lang,
      'source_lang' => substr($source_lang, 0, 2),
      'target_lang' => substr($target_lang, 0, 2),

That's how it works for me.

🐛 Bug report
Status

Active

Version

2.2

Component

Code

Created by

🇩🇪Germany bit-checker

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

Comments & Activities

Production build 0.71.5 2024