How one becomes lazy (when one is being translated by Django)

I’ve enjoyed digging even deeper into the lazy text questions that I came up with last time. The “thingamajig” returned by ugettext_lazy indeed waits until unicode is called upon it, then it runs through translation.
You can see this by the way ugettext_lazy is defined. It’s in core/utils/translation/__init__.py:

core/utils/translation/__init__.py

ugettext_lazy = lazy(ugettext, unicode)

That call to lazy [...]

More



How lazy can text get?

Inspired by Malcolm Tredinnick’s appearance on TWiD 19, I decided to create a small dummy site and work through the steps of translating it to German.
Setting up all the translation files was easy enough, but then the first thing that bit me was overlooking this instruction on Django’s Internationalization documentation page:
Always use lazy translations in [...]

More