mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Patch #1349274: gettext.install() now optionally installs additional
translation functions other than _() in the builtin namespace.
This commit is contained in:
parent
e466217ab9
commit
602b9ba6b3
4 changed files with 41 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue