Skip to content

Commit

Permalink
Fix formatting in ncurses mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvr committed May 4, 2020
1 parent ed46e37 commit 1355595
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ def __init__(self, translationsFile = '', lang = '', mode = 'curses') :
def tr(self,s) :
if self.lang and self.doc :
rs = s.replace("'",''').replace("\\", '"')
results = self.doc.xpathEval('/TS/context/message[source = \'%s\']/translation/text()'%(rs,))
results = self.doc.xpathEval('/TS/context/message[source = \'{}\']/translation/text()'.format(rs))
if not results :
return s
contents = results[0].content.replace(''',"'").replace('"',"\\").decode('utf-8')
if self.mode == 'curses' :
contents = contents.encode(locale.getpreferredencoding())
contents = results[0].content.replace(''',"'").replace('"',"\\")
if type(contents) == bytes:
contents = contents.decode('utf-8')
return contents
else :
return s

0 comments on commit 1355595

Please sign in to comment.