Merge "Update adoption notes about Message objects"

This commit is contained in:
Jenkins 2014-07-03 19:25:31 +00:00 committed by Gerrit Code Review
commit dae94619cd
1 changed files with 10 additions and 2 deletions

View File

@ -2,8 +2,6 @@
Graduating oslo.i18n
======================
Include the URL of your launchpad blueprint:
https://blueprints.launchpad.net/oslo/+spec/graduate-oslo-i18n
oslo.i18n includes modules related to internationalization and
@ -120,6 +118,16 @@ module instead of using oslo.i18n directly. This is documented in the
usage.rst page for the library:
http://docs.openstack.org/developer/oslo.i18n/usage.html
In addition to the marker functions, some apps are using the
:class:`Message` class from :mod:`gettextutils`. That class is meant
to be a private implementation detail of lazy translation, and is not
exposed in the public API of ``oslo.i18n``. To convert a Message to a
translated string, use :func:`translate`. To instantiate a new
Message, use :func:`enable_lazy` to turn lazy translation on and then
use a property of a :class:`TranslatorFactory` (e.g.,
``TranslatorFactory().primary``) to get a translation function, which
will return a Message object.
Dependencies
============