I18n on Google App Engine 1.4.3 and django 1.2

I found several tutorials that show how to use i18n on gae, but they assume django 0.96. Right now I do not have, for example, a separate script for makemessages, and I can not run manage.py. Has anyone tried using i18n recently and could explain to me how this can be done?

EDIT

I was able to generate po files and compile them. I get the language headers and I can install the langauge translation. self.request.LANGUAGE_CODE set to pl , which is just fine. Nevertheless, these translations are not used when displaying a web page. You do not know why this can happen?

EDIT2

Well, after completing the trial / error that I was able to detect, you need to import the settings from django.conf and reload them (setting._target = None). And it finally works.

+4
source share
1 answer

We work, or at least think what we are doing. We use django 0.96 compilation script messages to compile .po files and have upgraded to django 1.2 using I18NRequestHandler, so I want to confirm that it works. You can look at our code at http://montao.googlecode.com and we do not use manage.py, since we do not use all django. I hope this helps. I needed to add import saying from django.utils.translation import gettext_lazy as _ , otherwise most django 0.96 was easy to upgrade to 1.2. To activate the translation, we can now use the hl parameter for the HTTP request, for example, for Greek translations: http://classifiedsmarket.appspot.com/?hl=el , and the text in the Greek displays from the .mo files compiled using the script compile-messages.py

+1
source

All Articles