Can someone help me with m Django localization?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-05-20T22:48:57Z Indexed on 2010/05/20 23:20 UTC
Read the original article Hit count: 321

I have a template with has text in it. It's located in /templates under my project directory.

I'm trying to do Japanese now. I create a directory called "locale" in my project directory. Then, I set up this in my settings:

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

After that, I run this command: django-admin.py makemessages -l ja

The only problem is, this doesn't work! In my locale/ja/LC_MESSAGES/django.po:

Isn't it supposed to scan my templates with .html extension and grab all the strings?

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-05-20 22:45+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: settings.py:101
msgid "German"
msgstr ""

#: settings.py:102
msgid "English"
msgstr ""

#: settings.py:103
msgid "Japanese"
msgstr ""

© Stack Overflow or respective owner

Related posts about django

Related posts about python