diff options
author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2014-06-26 05:55:26 -0700 |
---|---|---|
committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2014-07-13 12:35:15 -0700 |
commit | a4fc251e94c94c4a33a218c99271f601dd87b268 (patch) | |
tree | 63798c3dea439acf8b58b59b4ac1b062b0253f5d | |
parent | 53edb42b7531273d5126af322946caf076adfb02 (diff) | |
download | oslo-i18n-a4fc251e94c94c4a33a218c99271f601dd87b268.tar.gz |
Remove mention of Message objects from public docs
The Message class is not part of the public API of the library, so don't
refer to it in documentation that appears for the public API.
Change-Id: Ie28ce6f8f2c2de351c8a233b7de9dc31abaa9e04
-rw-r--r-- | oslo/i18n/_gettextutils.py | 5 | ||||
-rw-r--r-- | oslo/i18n/log.py | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/oslo/i18n/_gettextutils.py b/oslo/i18n/_gettextutils.py index d7ddeb5..466c2c9 100644 --- a/oslo/i18n/_gettextutils.py +++ b/oslo/i18n/_gettextutils.py @@ -45,11 +45,6 @@ def install(domain): NOVA_LOCALEDIR). :param domain: the translation domain - :param lazy: indicates whether or not to install the lazy _() function. - The lazy _() introduces a way to do deferred translation - of messages by installing a _ that builds Message objects, - instead of strings, which can then be lazily translated into - any available locale. """ from six import moves tf = _factory.TranslatorFactory(domain) diff --git a/oslo/i18n/log.py b/oslo/i18n/log.py index a2bd4c8..8ae19e6 100644 --- a/oslo/i18n/log.py +++ b/oslo/i18n/log.py @@ -25,9 +25,15 @@ from oslo.i18n import _translate class TranslationHandler(handlers.MemoryHandler): """Handler that translates records before logging them. - The TranslationHandler takes a locale and a target logging.Handler object - to forward LogRecord objects to after translating them. This handler - depends on Message objects being logged, instead of regular strings. + When lazy translation is enabled in the application (see + :func:`~oslo.i18n.enable_lazy`), the :class:`TranslationHandler` + uses its locale configuration setting to determine how to + translate LogRecord objects before forwarding them to the + logging.Handler. + + When lazy translation is disabled, the message in the LogRecord is + converted to unicode without any changes and then forwarded to the + logging.Handler. The handler can be configured declaratively in the ``logging.conf`` as follows:: |