doc: contextual/plural translation requires oslo.i18n >=2.1.0

We introduced contextual/plural translation in version 2.1.0,
so declare this in documentation to avoid AttributeError.

Change-Id: Iadc24d19e2a2b799a5009a806ee7c64867b1d554
Related-Bug: #1525992
This commit is contained in:
ChangBo Guo(gcb) 2015-12-23 11:09:03 +08:00
parent 59bb7070f3
commit e749d84f3b
2 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,9 @@ And recommend the following code to use plural form::
The contextual form and plural form are used only when needed. The contextual form and plural form are used only when needed.
By default, the translation should use the ``_()``. By default, the translation should use the ``_()``.
.. note::
These two functions were only available in oslo.i18n >= 2.1.0.
Log Translation Log Translation
=============== ===============

View File

@ -41,9 +41,11 @@ the marker functions the factory creates.
_ = _translators.primary _ = _translators.primary
# The contextual translation function using the name "_C" # The contextual translation function using the name "_C"
# requires oslo.i18n >=2.1.0
_C = _translators.contextual_form _C = _translators.contextual_form
# The plural translation function using the name "_P" # The plural translation function using the name "_P"
# requires oslo.i18n >=2.1.0
_P = _translators.plural_form _P = _translators.plural_form
# Translators for log levels. # Translators for log levels.