This will work as expected:
{{{
from django.utils.translation import ugettext_lazy
my_string = ugettext_lazy("This will be recognized.")
}}}
This will also work:
{{{
from django.utils.translation import ugettext_lazy as _
my_string = _("This will also be recognized.")
}}}
But this will not:
{{{
from django.utils.translation import ugettext_lazy as lazy_
my_string = lazy_("This will not be recognized.")
}}}
This wouldn't be too much of a problem in many cases, but if you need to
use more than one translation function in your code, this WILL be a
problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/24517>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0
Comment:
That's the expected behavior. If you need several translation functions,
use their full name in the code. And in the case you'd *really* need
another function name, you have the possibility of creating a custom
makemessages command and override the `xgettext_options` class attribute
(new in 1.7) to include some more `--keyword` xgettext options.
--
Ticket URL: <https://code.djangoproject.com/ticket/24517#comment:1>