Skip to content

Commit

Permalink
Display the sentence when translation not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Ydrasil committed Jun 6, 2017
1 parent 9c4eefe commit 9474ae6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions tcii18n/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ def translate(self, sentence, **kwargs):
for key, value in kwargs.items():
row[1] = row[1] % {key: value}
return row[1]
return sentence
3 changes: 3 additions & 0 deletions test/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ def test_switch_language(self):
self.assertEqual(self.trans_it('TCI title'), 'ITC titolo')
self.assertEqual(self.trans_it('Welcome %(user)s!', user='John'),
'Benvenuto John!')

def test_display_unknown_message(self):
self.assertEqual(self.trans('Unknown message'), 'Unknown message')

0 comments on commit 9474ae6

Please sign in to comment.