django internationalization doesn't work

Posted by xRobot on Stack Overflow See other posts from Stack Overflow or by xRobot
Published on 2010-05-09T07:55:43Z Indexed on 2010/05/09 7:58 UTC
Read the original article Hit count: 563

I have:

  • created translation strings in the template and in the application view.
  • run this command: django-admin.py makemessages -l it and the file it/LC_MESSAGES/django.po has been created
  • run this command: django-admin.py compilemessages and I receive: processing file django.po in /home/jobber/Desktop/library/books/locale/it/LC_MESSAGES
  • set the language code in settings.py: LANGUAGE_CODE = 'it-IT'

but.... translation doesn't work !! I always see english text. Why ?

© Stack Overflow or respective owner

django internationalization doesn't work

Posted by xRobot on Stack Overflow See other posts from Stack Overflow or by xRobot
Published on 2010-05-09T09:32:31Z Indexed on 2010/05/09 9:38 UTC
Read the original article Hit count: 563

Filed under:

I have:

* created translation strings in the template and in the application view.
* run this command: django-admin.py makemessages -l it and the file it/LC_MESSAGES/django.po has been created
* translated strings in the django.po file.
* run this command: django-admin.py compilemessages and I receive: processing file django.po in /home/jobber/Desktop/library/books/locale/it/LC_MESSAGES
* set this in settings.py:

LANGUAGE_CODE = 'it'

TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.auth",

"django.core.context_processors.debug",

"django.core.context_processors.i18n",

"django.core.context_processors.media", )

USE_I18N = True

MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware',

'django.middleware.locale.LocaleMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',

'django.contrib.auth.middleware.AuthenticationMiddleware',

)

but.... translation doesn't work !! I always see english text. Why ?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-models