A quick guide to using DeepL glossaries in translations
pip install --upgrade deepl
From here we can start putting together our Python code. In a file called main.py, We’ll begin by constructing a translator object, including your own auth key you can find in your account:
glossary.py
- this is because we only need to create the glossary once. Start with the same code to construct a translator object:
translator.create_glossary
, giving it a name, setting the source and target languages, and assigning the entries we just created:
glossary.py
will give us a response containing glossary_id
, which we can add to our initial translation in main.py
. Also be aware that when using a glossary, you will also need to include source_lang
as part of your request: