~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_i18n.py

  • Committer: Jelmer Vernooij
  • Date: 2011-07-14 22:14:52 UTC
  • mto: This revision was merged to the branch mainline in revision 6026.
  • Revision ID: jelmer@samba.org-20110714221452-hd1yap5lgdbsjyx3
Fix i18n use when no environment variables are set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib import i18n, tests
20
20
 
21
21
 
22
 
 
23
 
 
24
22
class ZzzTranslations(object):
25
23
    """Special Zzz translation for debugging i18n stuff.
26
24
 
91
89
    def test_multiline(self):
92
90
        self.assertEqual(u"zz{{spam\nham}}\n\nzz{{eggs\n}}",
93
91
                         i18n.gettext_per_paragraph("spam\nham\n\neggs\n"))
 
92
 
 
93
 
 
94
class TestInstall(tests.TestCase):
 
95
 
 
96
    def test_custom_languages(self):
 
97
        self.addCleanup(i18n.install)
 
98
        i18n.install('nl:fy')
 
99
 
 
100
    def test_no_env_variables(self):
 
101
        self.addCleanup(i18n.install)
 
102
        self.overrideEnv('LANGUAGE', None)
 
103
        self.overrideEnv('LC_ALL', None)
 
104
        self.overrideEnv('LC_MESSAGES', None)
 
105
        self.overrideEnv('LANG', None)
 
106
        i18n.install()