Don't do i18n activities before setup.
Review Request #8699 — Created Jan. 31, 2017 and submitted
Django 1.8 has a very nice feature where trying to call
ugettext
before the
i18n infrastructure has been started will result in an error (as opposed to
before, where it would just return the English string, thereby skipping the
translation).In our case, we had a couple different problems. In
reviews/fields.py
we were
just usingugettext
where we ought be be usingugettext_lazy
. In the auth
forms, we had a couple places where we usedugettext_lazy
but then
immediately did a string format operation on the result, which evaluated the
lazy string. I've moved these into the__init__
method instead.
- Ran unit tests.
- Verified that help text showed up correctly.