V
V
Vasily Vorobyov2015-11-14 00:59:05
Django
Vasily Vorobyov, 2015-11-14 00:59:05

How does django determine what language {%blocktrans%} should be translated into?

Placed word in {%blocktrans%},
executed

./env/bin/django-admin.py makemessages -l en
./env/bin/django-admin.py makemessages -l ru

Added the key from blocktrans to both .po files, but i18n doesn't work. What am I doing wrong?
UPD1
The locale folder is on the same level as manage.py
settings.py:
USE_I18N = True
USE_L10N = True

LANGUAGE_CODE = 'en'

LANGUAGES = (
    ('ru', _('Russian')),
    ('en', _('English')),
)

ugettext = lambda s: s

LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'locale'),
)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolay Korotkiy, 2015-11-14
@sikmir

django-admin.py compilemessages forgot?

O
Oscar Django, 2015-11-14
@winordie

I apologize for the stupid question: did you actually translate them?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question