DeepLcom / deepl-node

Official Node.js library for the DeepL language translation API.
MIT License
364 stars 22 forks source link

Translation based on glossary with deepl-node doesnt work #52

Open meierdean opened 2 months ago

meierdean commented 2 months ago

Describe the bug With the npm package "deepl-node" it is not possible to make translations based on a glossary. It works with a normal fetch instead of using the library.

To Reproduce Steps to reproduce the behavior:

  1. install the npm-package "deepl-node"
  2. add a glossary to deepl
  3. use the function "translateText" with an existing glossaryId

Expected behavior The glossary should be included when translating and the resulted translation should contain the defined word from the glossary.

JanEbbing commented 2 months ago

Hi, what exactly does not work about this? Do you get an error? is the glossary not applied? We have a test covering this use case and I cannot reproduce this locally.

I checked with const result = await translator.translateText('That is hot', 'EN', targetLang, {glossary: '0a6c701e-303a-41ba-a167-857c5b720a4c'});

which is translated to "Das ist heiß" without a glossary and "Das ist scharf" with a glossary that maps 'hot' => 'scharf'.

Edit: On deepl-node v1.13.0.