aboutsummaryrefslogtreecommitdiff
path: root/modules/translate.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-26 13:41:40 +0000
committerGravatar jesopo2019-11-26 13:42:01 +0000
commit2d21dfa22931bdb887ccccba4a33e6fa4755e94b (patch)
tree6ef5e304e3e9a69f9afd66ac0bee4d98ec115399 /modules/translate.py
parentremove all `eagle` stuff from nr.py (diff)
signature
utils.http.Response.data should always be `bytes` - add .decode and .soup
Diffstat (limited to 'modules/translate.py')
-rw-r--r--modules/translate.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/translate.py b/modules/translate.py
index b12f0d0a..e11de291 100644
--- a/modules/translate.py
+++ b/modules/translate.py
@@ -35,11 +35,11 @@ class Module(ModuleManager.BaseModule):
phrase = phrase.split(" ", 1)[1]
page = utils.http.request(URL_TRANSLATE, get_params={
- "client": "gtx", "sl": source_language,
- "tl": target_language, "dt": "t", "q": phrase})
+ "client": "gtx", "dt": "t", "q": phrase,
+ "sl": source_language, "tl": target_language})
if page and not page.data.startswith(b"[null,null,"):
- data = page.data.decode("utf8")
+ data = page.decode("utf8")
while ",," in data:
data = data.replace(",,", ",null,")
data = data.replace("[,", "[null,")