18 January 2009 3 comments Django
I've done a site that is initially only going to be in Swedish. So I set the
LANGUAGE_CODE like this:
# Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'sv-SE'
I then go ahead and mark my templates and code and run
django-admin.py makemessages -l sv-SE. Then I fire up Poedit to translate the
.po file and then compile to make the
.mo file, so now I had a file called
<my project>/locale/sv-SE/LC_MESSAGES/django.mo but it just wouldn't work!! I tried debugging
django.utils.translation with little success. Eventually through trial-and-error I found that if I change it to "sv" instead of "sv-SE" it works.
Is this a problem with gettext or a problem somewhere in Django? It might cause equally much headache for other developers so I wouldn't mind that we get to the bottom of this.Follow @peterbe on Twitter