Oh.
https://docs.djangoproject.com/en/dev/howto/custom-management-commands/#management-commands-and-locales
I forgot to mention that the signal is executed as a result of a loaddata
management command. So management commands don't respect
settings.LANGUAGE_CODE? That makes no sense.
On Wednesday, 18 June 2014 12:48:47 UTC-4, Stodge wrote:
>
> My settings for languages are:
>
> LANGUAGE_CODE = 'en'
>
> USE_I18N = True
> LANGUAGE_COOKIE_NAME='django_language'
> ugettext = lambda s: s
> LANGUAGES = (
> ('en', ugettext('English')),
> ('de', ugettext('German')),
> ('fr', ugettext('French'))
> )
>
>
> I have a post-save signal that creates instances of a model and gets the
> current Django language. The language returned is for some reason "en-us",
> but I have no idea where this is coming from. My default as shown above is
> "en". get_language() is called from within a signal so the language isn't
> being taken from a cookie or request header. Any ideas why Django thinks
> the current (default) language is "en-us"? Thanks
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/10e0fe6d-1cf2-487d-aa70-023aef943414%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.