#2512 implement the 3.0 gettext API

All the u* gettext variants were renamed to their
none u* variants, since there's no point in translating
to byte strings. I also killed off the unicode parameters
for install
This commit is contained in:
Benjamin Peterson 2008-07-14 14:32:15 +00:00
parent fbe94c55ca
commit 801844d6fc
4 changed files with 89 additions and 154 deletions

View file

@ -143,13 +143,13 @@ trggrkg zrffntr pngnybt yvoenel.''')
t.install()
eq(_('nudge nudge'), 'wink wink')
# Try unicode return type
t.install(str=True)
t.install()
eq(_('mullusk'), 'bacon')
# Test installation of other methods
import builtins
t.install(str=True, names=["gettext", "lgettext"])
eq(_, t.ugettext)
eq(builtins.gettext, t.ugettext)
t.install(names=["gettext", "lgettext"])
eq(_, t.gettext)
eq(builtins.gettext, t.gettext)
eq(lgettext, t.lgettext)
del builtins.gettext
del builtins.lgettext
@ -305,7 +305,7 @@ class UnicodeTranslationsTest(GettextBaseTest):
self.t = gettext.GNUTranslations(fp)
finally:
fp.close()
self._ = self.t.ugettext
self._ = self.t.gettext
def test_unicode_msgid(self):
unless = self.failUnless