views:

73

answers:

2

Can someone help me with Localization? I put {% trans "..." %} in my template, I filled in my django.po after running "makemessages".

#: templates/main_content.html:136
msgid "Go to page"
msgstr "▒~C~Z▒~C▒▒~B▒▒~L~G▒~Z"

#: templates/main_content.html:138
msgid "Page"
msgstr "▒~C~Z▒~C▒▒~B▒"

#: templates/main_content.html:154
msgid "Next"
msgstr "次"

Then, I set LANGUAGES={} in my settings.py along with "gettext lambda":

gettext = lambda s: s
LANGUAGES = (
    ('de', gettext('German')),
    ('en', gettext('English')),
    ('ja', gettext('Japanese')),
)

Of course, I installed the LocaleMiddleware. I also set the request.session['django_language'] = "ja"

How do I test that this is working? How do I see japanese on my site!?

A: 

Set your browser (or whatever web user agent you're using to test this site) so that its Accept-Language request header value is ja.

Alex Martelli
It didn't change the text, but the response header did say "Content-Language: ja"
TIMEX
A: 

Solved. I compiled the messages.

TIMEX