Code: Select all
from django.utils.translation import gettext_lazy as _
< /code>
und dann wie folgt angewendet: < /p>
{
"code": _("some name to be translated"),
# ....
}
< /code>
Dies scheint größtenteils zu funktionieren, aber ich stieß auf Probleme mit Sellerie- und Multiprozessierungsunterstützung zu, und alles, was versucht, meine Modelle auf etwas anderes als die Vanille -Art zu importieren.django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
Code: Select all
django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
Das Traceback für letztere beginnt bei meiner Verwendung von getText_lazy in Constants.py .>