MoinMoin.i18n package

Module contents

MoinMoin - i18n (internationalization) and l10n (localization) support

To use this, please use exactly this line (no less, no more):

from MoinMoin.i18n import _, L_, N_

# _ == gettext
# N_ == ngettext
# L_ == lazy_gettext
MoinMoin.i18n.force_locale(*args, **kwds)[source]

Temporarily overrides the currently selected locale. Sometimes it is useful to switch the current locale to different one, do some tasks and then revert back to the original one. For example, if the user uses German on the web site, but you want to send them an email in English, you can use this function as a context manager:

with force_locale('en_US'):
    send_email(gettext('Hello!'), ...)
MoinMoin.i18n.get_locale()[source]

return the locale for the current user

MoinMoin.i18n.get_timezone()[source]

return the timezone for the current user

MoinMoin.i18n.i18n_init(app)[source]

initialize Flask-Babel