mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#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:
parent
fbe94c55ca
commit
801844d6fc
4 changed files with 89 additions and 154 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue