我已經創建了翻譯字符串。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