37,720
社区成员
发帖
与我相关
我的任务
分享
USE_I18N = True
USE_L10N = True
LANGUAGE_CODE = 'zh-CN'
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
#: .\forms.py:13 .\views.py:20
msgid "Weekly"
msgstr "每周"
from django.utils.translation import ugettext as _
def i18n(request):
from django.utils import translation
return HttpResponse( "%s %s %s" % (_("Weekly"), translation.get_language(),"haha" ) )
pass
Weekly zh-cn haha