这是我的设置.py
CMS_LANGUAGE_CONF = {
'en':['es'],
'es':['en'],
}
CMS_SITE_LANGUAGES = {
1:['en','es'],
}
CMS_LANGUAGES = (
('es', gettext('Spanish')),
('en', gettext('English')),
)
CMS_HIDE_UNTRANSLATED = True
LANGUAGES = [('es', 'Spanish'),('en', 'English')]
DEFAULT_LANGUAGE = 1
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
# 'django.middleware.locale.LocaleMiddleware',
'cms.middleware.multilingual.MultilingualURLMiddleware',
# 'vclubcms.middleware.URLMiddlewares.CustomMultilingualURLMiddleware'
)
我的问题是:
当我访问myserver时:8000 / myview呈现。
当我访问myserver:8000 / cmspage它呈现
在cms页面上我有一些链接。由于多种语言而转换为/language_code/cmspage
。所以当点击链接时它没有打开。
e.g。 myserver:8000 / language_code / cmspage无效
我尝试过这个链接 http://ilian.i-n-i.org/language-redirects-for-multilingual-sites-with-django-cms/comment-page-1/
并启用
'vclubcms.middleware.URLMiddlewares.CustomMultilingualURLMiddleware'
然后我运行myserver:8000 / language_code / cmspage
显示
The page isn't redirecting properly
并且有21个请求。
请建议我该如何解决这个问题。