mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
take django_language either from GET or POST (GET has preference if both
are given) git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4196ff0b17
commit
5e24a67952
@ -185,8 +185,8 @@ def get_language_from_request(request):
|
|||||||
"""
|
"""
|
||||||
global _accepted
|
global _accepted
|
||||||
|
|
||||||
if request.GET:
|
if request.GET or request.POST:
|
||||||
lang = request.GET.get('django_language', None)
|
lang = request.GET.get('django_language', None) or request.POST.get('django_language', None)
|
||||||
if lang is not None:
|
if lang is not None:
|
||||||
if hasattr(request, 'session'):
|
if hasattr(request, 'session'):
|
||||||
request.session['django_language'] = lang
|
request.session['django_language'] = lang
|
||||||
|
Loading…
x
Reference in New Issue
Block a user