#25131: language changes randomly
--------------------------------------+--------------------
     Reporter:  va-dev                |      Owner:  nobody
         Type:  Uncategorized         |     Status:  new
    Component:  Internationalization  |    Version:  1.8
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 I use decorator for temporal language activation:
 {{{
 from django.utils.translation import get_language, activate

 def wrap_language(f):

     @wraps(f)
     def wrapper(request, *args, **kwargs):
         company = get_company(request)
         cs = retrieve_company_settings(company)

         current_language = get_language()
         activate(cs.language.lower())

         response = f(request, *args, **kwargs)

         activate(current_language)

         return response

     return wrapper
 }}}
 I've met a problem that when i frequently update any page of my website,
 language sometimes changes randomly.

 My gunicorn command:

 {{{
 gunicorn mysite.wsgi:application -b unix:/tmp/mysite.sock --workers 5
 --threads 5
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25131>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.b09062d7b4892044cc6e409ef34c2217%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to