我已经创建了翻译字符串。Django的国际化不起作用模板和应用程序视图
然后我跑:
django-admin.py makemessages -l it
,并/ LC_MESSAGES/django.po已经创造了django.po文件
我现在已经翻译字符串的文件,然后我跑:
django-admin.py compilemessages
我收到:
processing file django.po in /home/jobber/Desktop/library/books/locale/it/LC_MESSAGES
我的settings.py看起来是这样的:
LANGUAGE_CODE = 'it'
TEMPLATE_CONTEXT_PROCESSORS = ("django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",)
USE_I18N = True
MIDDLEWARE_CLASSES = ('django.middleware.common.CommonMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
但我还是经常看到英文文本。为什么?
哈哈你rightttttt!谢谢 :) – xRobot 2010-05-09 11:29:23