Patch #1349274: gettext.install() now optionally installs additional

translation functions other than _() in the builtin namespace.
This commit is contained in:
Georg Brandl 2006-02-19 13:26:36 +00:00
parent e466217ab9
commit 602b9ba6b3
4 changed files with 41 additions and 5 deletions

View file

@ -145,6 +145,14 @@ trggrkg zrffntr pngnybt yvoenel.''')
# Try unicode return type
t.install(unicode=True)
eq(_('mullusk'), 'bacon')
# Test installation of other methods
import __builtin__
t.install(unicode=True, names=["gettext", "lgettext"])
eq(_, t.ugettext)
eq(__builtin__.gettext, t.ugettext)
eq(lgettext, t.lgettext)
del __builtin__.gettext
del __builtin__.lgettext
class GettextTestCase2(GettextBaseTest):