problem with markup in xml
Closed this issue · 0 comments
XilinJia commented
<string name="about_text_version">version <b>%1$s</b></string>
The above line in my file caused the following errors:
Traceback (most recent call last):
File "translate.py", line 262, in
root[i][element].tail = " " + translate(root[i][element].tail, OUTPUTLANGUAGE, INPUTLANGUAGE).replace('\ ', '\').replace('\ n ', '\n').replace('\n ', '\n').replace('/ ', '/')
File "translate.py", line 177, in translate
r = requests.get("https://translate.google.com/m?hl=%s&sl=%s&q=%s"% (to_language, language, to_translate.replace(" ", "+")))
AttributeError: 'NoneType' object has no attribute 'replace'
It works after I removed "%1$s" from the line.