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
ugettextbefore 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.pywe were
just usingugettextwhere we ought be be usingugettext_lazy. In the auth
forms, we had a couple places where we usedugettext_lazybut 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.
Tool: Pyflakes Processed Files: reviewboard/accounts/forms/auth.py reviewboard/reviews/fields.py Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/forms/auth.py reviewboard/reviews/fields.py