Translation from templates doesn't work.

37 views
Skip to first unread message

Shahar Or

unread,
Nov 24, 2013, 2:21:12 AM11/24/13
to django...@googlegroups.com
String in my template don't translate. They stay English even though they do pop up in the po files using `makemessages`.

To make sure that the current `lang` is indeed what I expect it to be, I use `{{ lang }}` in the template somewhere.

I have `{% load i18n %}` in the template somewhere near the top. Does the order matter?

I have `USE_I18N = True` and
```
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.i18n',
    'django.core.context_processors.request',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'cms.context_processors.media',
    'sekizai.context_processors.sekizai',
    'bidiutils.context_processors.bidi',
)
```

I restart the server and still I get no translation.

I don't know whether translation from code such as views works because I didn't code any views. i'm only using `django-cms` and in it's scope translation does seem to work because it's interface gets translated and I do get the pages in the language that I expect.

gilberto dos santos alves

unread,
Nov 24, 2013, 9:22:36 AM11/24/13
to django...@googlegroups.com
please could you post url or some more details!

Ramiro Morales

unread,
Nov 24, 2013, 1:06:50 PM11/24/13
to django...@googlegroups.com
On Sun, Nov 24, 2013 at 4:21 AM, Shahar Or <mightyia...@gmail.com> wrote:
> String in my template don't translate. They stay English even though they do
> pop up in the po files using `makemessages`.

Do you comvert these -po files to .mo files using the compilemessages
Django command or the msgfmt GNU gettext utility?

Otherwise the translations wont be picked up.


--
Ramiro Morales
@ramiromorales
Reply all
Reply to author
Forward
0 new messages