Skip to content

Commit

Permalink
Merge pull request #563 from benoit-pierre/tweak_translation_str/repr
Browse files Browse the repository at this point in the history
translation: tweak Translation.str/repr format
  • Loading branch information
morinted authored Aug 1, 2016
2 parents a0b9d52 + 5f28239 commit 287f79e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plover/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ def __ne__(self, other):
return not self.__eq__(other)

def __str__(self):
return 'Translation(%s : %s)' % (self.rtfcre, self.english)
if self.english is None:
translation = 'None'
else:
translation = escape_translation(self.english)
translation = '"%s"' % translation.replace('"', r'\"')
return 'Translation(%s : %s)' % (self.rtfcre, translation)

def __repr__(self):
return str(self)
Expand Down

0 comments on commit 287f79e

Please sign in to comment.