dag: prevent tag label overlapping with respect to current DAG orientation
[git-cola.git] / test / i18n_test.py
blob7340132e8770a99ec3315ed8d325429b85446154
1 from __future__ import absolute_import, division, unicode_literals
2 import unittest
4 from cola import i18n
5 from cola.i18n import N_
6 from cola.compat import unichr
9 class ColaI18nTestCase(unittest.TestCase):
10 """Test cases for the ColaApplication class"""
12 def tearDown(self):
13 i18n.uninstall()
15 def test_translates_noun(self):
16 """Test that strings with @@noun are translated
17 """
18 i18n.install('ja_JP')
19 expect = (unichr(0x30b3) + unichr(0x30df) +
20 unichr(0x30c3) + unichr(0x30c8))
21 actual = N_('Commit@@verb')
22 self.assertEqual(expect, actual)
24 def test_translates_verb(self):
25 """Test that strings with @@verb are translated
26 """
27 i18n.install('de_DE')
28 expect = 'Version aufnehmen'
29 actual = N_('Commit@@verb')
30 self.assertEqual(expect, actual)
32 def test_translates_english_noun(self):
33 """Test that English strings with @@noun are properly handled
34 """
35 i18n.install('en_US.UTF-8')
36 expect = 'Commit'
37 actual = N_('Commit@@noun')
38 self.assertEqual(expect, actual)
40 def test_translates_english_verb(self):
41 """Test that English strings with @@verb are properly handled
42 """
43 i18n.install('en_US.UTF-8')
44 expect = 'Commit'
45 actual = N_('Commit@@verb')
46 self.assertEqual(expect, actual)
48 def test_translates_random_english(self):
49 """Test that random English strings are passed through as-is
50 """
51 i18n.install('en_US.UTF-8')
52 expect = 'Random'
53 actual = N_('Random')
54 self.assertEqual(expect, actual)
57 if __name__ == '__main__':
58 unittest.main()