There is a view that switches the language to Russian:

class SetLangRuView(View): def get(self,request): activate('ru') request.session['lang'] = 'ru'; return redirect('main_page') 

The problem is the following: on the machine where development is underway, there are no problems with switching. The machine on Win 8.1, VPS, where the production is located, is Debian 3.16.7-ckt11-1 + deb8u2, and on the production, switching languages ​​does not work. And the question is how to fix it? The Russian locale has already been installed, rebooted, the problem has not disappeared. The full path to the folder locale prescribed, the situation has not changed. Here is an example of how djsngo shell works on win8.1

 >>> from django.utils.translation import activate, get_language,ugettext as _ >>> activate('ru') >>> _("Hellow") u'\u041f\u0440\u0438\u0432\u0435\u0442' >>> 

Here’s a debian production example:

 >>> from django.utils.translation import activate, get_language,ugettext as _ >>> activate('ru') >>> _("Hellow") u'Hellow' 

From which it follows that the problem is not the project, but somewhere in the system. Maybe someone has already treated like?

  • Let me guess: you forget to execute activate on all other views, right? - andreymal
  • No, activate I execute the request for each get. - Hanyuu Furude

0