Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get error on windows 10 #12

Open
bazarbashe opened this issue Oct 19, 2021 · 3 comments
Open

get error on windows 10 #12

bazarbashe opened this issue Oct 19, 2021 · 3 comments

Comments

@bazarbashe
Copy link

bazarbashe commented Oct 19, 2021

C:\Users\Administrator\Desktop\gourl-bitcoin-payment-gateway-paid-downloads-membership\languages>python3 tans.py
Traceback (most recent call last):
File "tans.py", line 3, in
run(fro="en", to="fa", src="C:/Users/Administrator/Desktop/gourl-bitcoin-payment-gateway-paid-downloads-membership/languages/untranslated", dest="C:/Users/Administrator/Desktop/gourl-bitcoin-payment-gateway-paid-downloads-membership/languages/translated")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\translate_po\main.py", line 55, in run
solve(os.path.join(arguments.dest, file), os.path.join(arguments.src, file), arguments)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\translate_po\main.py", line 27, in solve
line.msgstr = polib.unescape(translate(polib.escape(line.msgid), arguments))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\translate_po\main.py", line 15, in translate
return translator.translate(source, dest=arguments.to, src=arguments.fro).text
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\googletrans\client.py", line 182, in translate
data = self._translate(text, dest, src, kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\googletrans\client.py", line 78, in _translate
token = self.token_acquirer.do(text)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\googletrans\gtoken.py", line 194, in do
self._update()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\googletrans\gtoken.py", line 62, in _update
code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
AttributeError: 'NoneType' object has no attribute 'group'


tans.py include syntax is :
from translate_po.main import run

run(fro="en", to="fa", src="C:/Users/Administrator/Desktop/gourl-bitcoin-payment-gateway-paid-downloads-membership/languages/untranslated", dest="C:/Users/Administrator/Desktop/gourl-bitcoin-payment-gateway-paid-downloads-membership/languages/translated")


waiting for your response
finest regards

@loge5
Copy link

loge5 commented Nov 29, 2021

Got the same error under linux (Python 3.9.9)

@loge5
Copy link

loge5 commented Nov 29, 2021

After installing the current alpha-version of googletrans the program runs without errors:

pip install googletrans==3.1.0a0

But in the translated "po" file the textes are not translated (msgstr is the same as msgid).
I think thats because I already reached the api-limit and my IP was blocked.

@talistech
Copy link

After installing the current alpha-version of googletrans the program runs without errors:

pip install googletrans==3.1.0a0

But in the translated "po" file the textes are not translated (msgstr is the same as msgid). I think thats because I already reached the api-limit and my IP was blocked.

Can confirm this fix works on Ubuntu 22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants