Commit b980ed37 by Ned Batchelder

Merge pull request #2590 from edx/ned/small-tweak-to-early-translation-fix-docs

Small tweak to early-translation fix docs
parents d58358a4 1da4ac44
......@@ -521,15 +521,12 @@ defined::
HELLO = _("Hello")
GOODBYE = _("Goodbye")
_ = ugettext
def get_greeting(hello):
if hello:
return _(HELLO)
return ugettext(HELLO)
else:
return _(GOODBYE)
return ugettext(GOODBYE)
Here we define ``_()`` as a pass-through function, so the string will be
found during extraction, but won't be translated too early. Then we redefine
``_()`` to be the real translation lookup function, and use it at runtime to
get the localized string.
Here we define ``_()`` as a pass-through function, so the string will be found
during extraction, but won't be translated too early. Then we use the real
translation function at runtime to get the localized string.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment