From 88fbf6ec9e8562b3d1d0fcba7765849f44466856 Mon Sep 17 00:00:00 2001
From: Fabian Rausch <fabian.rausch@pwc.com>
Date: Sat, 24 Oct 2020 00:59:29 +0200
Subject: [PATCH] Send source language in request to improve translation result

---
 deepl_api.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/deepl_api.py b/deepl_api.py
index d0ddccd..df1248f 100644
--- a/deepl_api.py
+++ b/deepl_api.py
@@ -7,7 +7,7 @@ def read_file(path):
     return data
 
 def get_translation(text, target_lang):
-    args = {"auth_key": auth_key, "text": text, "target_lang": target_lang}
+    args = {"auth_key": auth_key, "text": text, "target_lang": target_lang, "source_lang": "DE"}
     r = requests.get("https://api.deepl.com/v2/translate", params = args)
     return r.text
 
-- 
GitLab