If you do the following: 1. Translate a kb article adding a missing link. For example, "[[Ricky Rocks]]". 2. Approve the translation. 3. View the translation. If you hover over "Ricky Rocks", it'll say a tooltip like "Page does not exist" in the language you're looking at it in (assuming that language has it translated (I used the Pirate translation, but had to re-add it to LANGUAGE_CHOICES first)). 4. Then run: ./manage.py cron rebuild_kb which will go through and re-parse everything. 5. Once that is done (takes like 30 minutes on my machine--good coffee break), then go back and view the translation again. Outcome: The tool tip is in English because rebuild_kb parses everything using the english locale so gettext calls all return English. Expected: The tool tip is in the appropriate language.
I just fiddled with similar things when doing email template stuff and wrote a context manager for setting the locale. In the code we'd create a context, then do the gettext/rendering calls, and it'd work fine. I'm pretty sure this is a 1 pointer.
In a pull request: https://github.com/mozilla/kitsune/pull/1179
Landed on master: https://github.com/mozilla/kitsune/commit/58df24c49fdeefb74cda547390984fd3b8ba95e2
GAH! I didn't deploy yet
Deployed to prod now.