commit/instantTranslate: parkcorp: temporary fix.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Sat, 01 Aug 2015 18:11:06 -0000

1 new commit in instantTranslate:

https://bitbucket.org/nvdaaddonteam/instanttranslate/commits/a40868847fbc/
Changeset: a40868847fbc
Branch: master
User: parkcorp
Date: 2015-08-01 18:10:45+00:00
Summary: temporary fix.

don't know if it is correct, but it works.

Affected #: 1 file

diff --git a/addon/globalPlugins/instantTranslate/translator.py
b/addon/globalPlugins/instantTranslate/translator.py
index 5286235..c58d2c3 100644
--- a/addon/globalPlugins/instantTranslate/translator.py
+++ b/addon/globalPlugins/instantTranslate/translator.py
@@ -84,7 +84,7 @@ class Translator(threading.Thread):

def buildRequest(self, text, lang_from, lang_to):
"""Build POST request which will be sent to Google."""
- urlTemplate =
'http://www.google.com/translate_a/t?client=t&sl={lang_from}&tl={lang_to}&ie=utf-8&oe=utf-8'
+ urlTemplate =
'http://translate.google.com/translate_a/single?client=t&sl={lang_from}&tl={lang_to}&ie=utf-8&oe=utf-8&dt=t&dt=bd'
url = urlTemplate.format(lang_from=lang_from, lang_to=lang_to)
header = {'User-agent': 'Mozilla/5.0', 'Content-Type':
'application/x-www-form-urlencoded'}
data = 'text=%s' %urllib2.quote(text)

Repository URL: https://bitbucket.org/nvdaaddonteam/instanttranslate/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/instantTranslate: parkcorp: temporary fix. - commits-noreply