gettext for openstack-common modules.
Usual usage in an openstack.common module:
from openstack_dashboard.openstack.common.gettextutils import _
Bases: logging.Handler
Handler that can have a locale associated to translate Messages.
A quick example of how to utilize the Message class above. LocaleHandler takes a locale and a target logging.Handler object to forward LogRecord objects to after translating the internal Message.
Bases: UserString.UserString, object
Class used to encapsulate translatable messages.
Assemble and return a lazy gettext function for a given domain.
Factory method for a project/module to get a lazy gettext function for its own translation domain (i.e. nova, glance, cinder, etc.)
Install a _() function using the given translation domain.
Given a translation domain, install a _() function using gettext’s install() function.
The main difference from gettext.install() is that we allow overriding the default localedir (e.g. /usr/share/locale) using a translation-domain-specific environment variable (e.g. NOVA_LOCALEDIR).