views:

28

answers:

2

this is the demo.rar file.

1 . i use this code to create a zh-CN :

django-admin.py makemessages -l zh-CN

2 . i add some string to django.po :

msgid "zjm1126"
msgstr "哈哈哈!!!"

3 . and then compile it :

django-admin.py compilemessages

but i don't find it become chinese words

so why ?

thanks

A: 

You need to also take two more steps:

  1. Mark the string "zjm1126" for translation in your template, for example with {% trans "zjm1126" %}.

  2. Activate Chinese as the current language. This is often done for you by Django, but you can do it explicitly if you need to.

Ned Batchelder
can you look the demo.rar and change it for me , that is a simple code.
zjm1126
A: 

use django-admin.py makemessages -l zh_CN

not user django-admin.py makemessages -l zh-CN

zh_CN is different from zh-CN

zjm1126