Django l10n / i18n : local language no passed on request

shouldn’t this conversation be on commcare-developers?

forwarding here, in case someone else want to put django into other
unsupported languages.

··· On Mon, Apr 11, 2011 at 7:33 PM, Rowena Luk wrote:

The docs are actually really helpful. It’s just that there’s too much of
them to parse. Here’s the nugget you’re looking for:
*
*

Locale restrictions

Django does not support localizing your application into a locale for
which Django itself has not been translated. In this case, it will ignore
your translation files. If you were to try this and Django supported it, you
would inevitably see a mixture of translated strings (from your application)
and English strings (from Django itself). If you want to support a locale
for your application that is not already part of Django, you’ll need to make
at least a minimal translation of the Django core.

A good starting point is to copy the Django English .po file and to
translate at least some translation stringshttp://docs.djangoproject.com/en/dev/topics/i18n/#term-translation-string
.

So, basically,

  1. go into wherenver django is installed (in my case,
    /usr/local/lib/python2.6/dist-packages/django), go into the
    conf/locale/en/LC_messages folder, copy django.po and djangojs.po into
    conf/locale/sw/LC_MESSAGES,
    2 update all the translations into swahili that you care about
  2. compile them into mo
  3. restart django

After that, it should just be a matter of setting your LANGUAGE_CODE to
’sw’ and the LANGUAGES as you already have. No need for crazy middleware or
request/session variable munging.

On Mon, Apr 11, 2011 at 2:48 PM, Allen Machary allen.machary@gmail.comwrote:

Thanx for the response… much appriciated…

Allen Machary
sent from phone

On 11 Apr 2011 02:38, “Dan Myung” dmyung@dimagi.com wrote:

Hi Allen,
Unfortunately you might need to wait for Ro on this when she gets back
online, my knowledge of the django internationalization
is only as good as the docs could take me.

Dan

On Sun, Apr 10, 2011 at 4:12 PM, Cory Zue czue@dimagi.com wrote:

Hi Allen,

Nice to hear …