views:

49

answers:

1

I want to localize a Django project on application basis, ie. have separate localization for each app, not the entire project.

Here's what I did:

cd <project root>
mkdir locale
django-admin makemessages -l ru

(translated some strings)

django-admin compilemessages

(added the language to settings.py, restarted the server)

USE_I18N = True
LANGUAGES = (
    ('en', u'English'),
    ('ru', u'Русский'),
)

The messages from the locale for the entire project showed correctly.

Then, instead I wanted to make it at applications level.

rm -rf locale
cd apps/myapp
mkdir locale
django-admin makemessages -l ru
cd ../../templates/myapp
mkdir locale
django-admin makemessages -l ru

(translated some strings)

django-admin compilemessages
cd ../../apps/myapp
django-admin compilemessages

(The locales now are compiled both in templates and apps directories.) (restart the server)

Everything remains in English even though my browser has 'ru' as a preferred language.

What am I doing wrong?

A: 

Did you included 'django.middleware.locale.LocaleMiddleware' in MIDDLEWARE_CLASSES?

Seitaridis