Problem/ Motivation
As an editor i want to use all languages available for the glossary functionality.
With the latest updates, all languages available for translations are now supported by the glossary.
Proposed resolution
- existing logic to retrieve available glossary languages is updated to use all translation source languages
User interface changes
- only languages available on the page are available while working with glossaries
- naming of languages is changed to match supported languages by DeepL API
Original Issue
I tried to add Arabic language glossary, but could not find the language on either the Source or Target language dropdown.
| Comment | File | Size | Author |
|---|---|---|---|
| DeepLGlossary.png | 103.89 KB | sachit.thapa |
Issue fork tmgmt_deepl-3521025
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 #2
steffenrThe language Arabic is not supported by the API for now.
Available languages are listed here: https://developers.deepl.com/docs/api-reference/glossaries/openapi-spec-...
Once the language is available via the API, i'll update the tmgmt_deepl_glossary submodule.
Comment #3
sachit.thapa commentedI made a GET request to the https://api.deepl.com/v2/glossary-language-pairs endpoint. While the response included multiple language pairs, I'm only including the English to Arabic pair:
{
"supported_languages": [
{
"source_lang": "en",
"target_lang": "ar"
}
]
}
Thank you for looking at this. :)
Comment #4
steffenrOh - you are right.
Since April 2025 all source languages are available for the glossary functionality and via the API endpoint.
Comment #5
steffenrComment #6
steffenrComment #7
steffenrComment #8
steffenrComment #9
steffenrComment #10
steffenrComment #12
sachit.thapa commentedThank you once again for taking care of this, but the merge failed due to phpcs and phpstans :(
Comment #13
steffenr@sachit.thapa: The tests for phpstan (next minor) won't be fixed for the 2.2.x release.
Those are handled in 2.3.x - were all pipelines are green.
It would be great, if you could test the Merge Request with version 2.2.x on you projects and provide feedback. Afterward i'll integrate the feature into 2.3.x.
Comment #14
sachit.thapa commented@steffenr, ! I've downloaded and tested MR !39 in my environment using version 2.2.x. I was able to see Arabic in both the source and target language as expected. I uploaded the glossary via Postman using the API endpoints, and everything worked smoothly without the issues I encountered earlier. I also tested editing and saving through Drupal, and it produced the expected results. Looks good on my end! Thanks
Comment #15
sachit.thapa commentedComment #16
steffenrI just had a look at related issues, which would be affected by the Merge Request.
I have to make some more changes to the selection of languages, since custom langcodes, which are mapped in the translator configuration won't show up.
Comment #18
steffenr