1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

Added i18n form login and myhome page

This commit is contained in:
zhengxie
2012-10-26 19:15:52 +08:00
parent 0106d08911
commit f76f396937
26 changed files with 468 additions and 129 deletions

View File

@@ -26,7 +26,7 @@ TIME_ZONE = 'Asia/Shanghai'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'zh_CN'
LANGUAGE_CODE = 'en'
SITE_ID = 1
@@ -65,6 +65,7 @@ MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'auth.middleware.AuthenticationMiddleware',
'base.middleware.BaseMiddleware',
@@ -85,6 +86,17 @@ TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__),'thirdpart/djangorestframework/templates'),
)
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
LANGUAGES = (
('en', gettext_noop('English')),
('zh-cn', gettext_noop('Simplified Chinese')),
)
LOCALE_PATHS = (
os.path.join(os.path.dirname(__file__), 'locale'),
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.debug',