Hi everyone, 

I set the LANGUAGE_SESSION_KEY key in the current user's session to "en_US" 
(also tried with "en-us"), and my LANGUAGES settings is as follows:

LANGUAGES = [
    ('de', _('German')),
    ('en', _('English')),
]

According to the docs 
<https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#how-django-discovers-language-preference>,
 
Django should fall back to the base language "en" in this case. However, it 
doesn't.

While hunting down the bug, I stumbled upon 
django.utils.translation.trans_real 
<https://github.com/django/django/blob/master/django/utils/translation/trans_real.py>,
 
where the function responsible for discovering the appropriate 
language is defined. It's called get_language_from_request. 

At first glance, it looks like this function falls back to the base 
language for all the other modes of language discovery (URL, Cookies, 
Accept-Language header etc.) 
but 

*not when it reads from the user's session.*If anyone has knowledge about 
this issue, I would like to know:

1. Is this intended behavior or is this a bug?
2. Or am I doing something totally stupid?

Thanks for your help, 
Dibya

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/120ad219-a8c5-4e23-8760-499e30245e67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to