From fcb0aeb5647448902130cb5c3029ac25ee638ee7 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Mon, 17 Oct 2005 07:22:22 +0000 Subject: [PATCH] i18n: fixed settings and default settings files for i18n changes git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@897 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/conf/global_settings.py | 8 ++++++-- django/conf/project_template/settings/admin.py | 1 + django/conf/project_template/settings/main.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index 9f33fd7dec..a23c6d7edc 100644 --- a/django/conf/global_settings.py +++ b/django/conf/global_settings.py @@ -26,13 +26,17 @@ TIME_ZONE = 'America/Chicago' # Language code for this installation. All choices can be found here: # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes # http://blogs.law.harvard.edu/tech/stories/storyReader$15 -LANGUAGE_CODE = 'en-us' +# Language codes need to be given in locale format, not in HTML language +# format. So it's en_US and not en-us to store here. The HTML language +# is stored in the request.LANGUAGE_CODE variable and will depend on the +# users browser. +LANGUAGE_CODE = 'en' # Languages we provide translations for out of the base. The # language name should be the utf-8 encoded local name for the # language. LANGUAGES = ( - ('en-us', 'English'), + ('en', 'English'), ('de', 'Deutsch'), ('it', 'Italiano'), ('sr', 'Srpski'), diff --git a/django/conf/project_template/settings/admin.py b/django/conf/project_template/settings/admin.py index 603886a5f2..0f89c08029 100644 --- a/django/conf/project_template/settings/admin.py +++ b/django/conf/project_template/settings/admin.py @@ -10,6 +10,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.sessions.SessionMiddleware', 'django.middleware.admin.AdminUserRequired', 'django.middleware.common.CommonMiddleware', + 'django.middleware.locale.LocaleMiddleware', ) # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a diff --git a/django/conf/project_template/settings/main.py b/django/conf/project_template/settings/main.py index cbb32b7920..572b9842ef 100644 --- a/django/conf/project_template/settings/main.py +++ b/django/conf/project_template/settings/main.py @@ -8,7 +8,7 @@ ADMINS = ( MANAGERS = ADMINS -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'en_US' DATABASE_ENGINE = 'postgresql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. DATABASE_NAME = '' # Or path to database file if using sqlite3.