views:

168

answers:

1

I have created translation strings in the template and in the application view.

Then I ran:

django-admin.py makemessages -l it

and the file it/LC_MESSAGES/django.po has been created

I have now translated strings in the django.po file, and then I ran:

django-admin.py compilemessages

And I receive:

processing file django.po in /home/jobber/Desktop/library/books/locale/it/LC_MESSAGES

My settings.py looks like this:

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 I still always see English text. Why?

+4  A: 

Maybe your browser language is English. The LocaleMiddleware tries to detect the language based on this algorithm (i.e. Accept-Language HTTP header).
So you can either remove the LocaleMiddleware to avoid this or use the set_language redirect view.

aeby
haha you rightttttt !! thank you :)
xRobot