Skip to content

Commit d3e75ff

Browse files
committed
Add filename param to Translator#translate_document() method
1 parent c77c1fc commit d3e75ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deepl/translator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ def translate_document(
802802
target_lang: str,
803803
formality: Union[str, Formality] = Formality.DEFAULT,
804804
glossary: Union[str, GlossaryInfo, None] = None,
805+
filename: Optional[str] = None,
805806
) -> None:
806807
"""Upload document, translate it into the target language, and download
807808
result.
@@ -819,6 +820,8 @@ def translate_document(
819820
Formality enum, "less" or "more".
820821
:param glossary: (Optional) glossary or glossary ID to use for
821822
translation. Must match specified source_lang and target_lang.
823+
:param filename: (Optional) Filename including extension, only required
824+
if uploading string or bytes containing file content.
822825
823826
:raises DocumentTranslationException: If an error occurs during
824827
translation, the exception includes the document handle.
@@ -830,6 +833,7 @@ def translate_document(
830833
source_lang=source_lang,
831834
formality=formality,
832835
glossary=glossary,
836+
filename=filename,
833837
)
834838

835839
try:

0 commit comments

Comments
 (0)