[fp]) |
self._parse(fp)
if fp is not None
.
fp) |
fallback) |
message) |
message) |
New in version 2.4.
message) |
singular, plural, n) |
New in version 2.3.
singular, plural, n) |
New in version 2.4.
singular, plural, n) |
New in version 2.3.
) |
) |
) |
New in version 2.4.
charset) |
New in version 2.4.
[unicode [, names]]) |
If the names parameter is given, it must be a sequence containing
the names of functions you want to install in the builtin namespace in
addition to _(). Supported names are 'gettext'
(bound
to self.gettext() or self.ugettext() according to the
unicode flag), 'ngettext'
(bound to self.ngettext()
or self.ungettext() according to the unicode flag),
'lgettext'
and 'lngettext'
.
Note that this is only one way, albeit the most convenient way, to make the _ function available to your application. Because it affects the entire application globally, and specifically the built-in namespace, localized modules should never install _. Instead, they should use this code to make _ available to their module:
import gettext t = gettext.translation('mymodule', ...) _ = t.gettext
This puts _ only in the module's global namespace and so only affects calls within this module.
Changed in version 2.5: Added the names parameter.
See About this document... for information on suggesting changes.