From 16ca0252b3e431222cd5069f3e6d4f6ebe9f067b Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Wed, 9 Oct 2013 09:04:09 -0400 Subject: [PATCH] Clarify USE_I18N settings @jzoldak showed me that setting `USE_I18N = DEBUG` didn't actually accomplish what I had hoped it would -- changing DEBUG didn't also change USE_I18N. This pull request accomplishes what I was trying to accomplish, without being quite so clever about it. --- cms/envs/acceptance.py | 5 +++++ cms/envs/common.py | 2 +- cms/envs/dev.py | 1 + lms/envs/acceptance.py | 5 +++++ lms/envs/common.py | 2 +- lms/envs/dev.py | 1 + 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index 8d7051a243..e5ed2261b5 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -79,6 +79,11 @@ DATABASES = { # Use the auto_auth workflow for creating users and logging them in MITX_FEATURES['AUTOMATIC_AUTH_FOR_TESTING'] = True +# HACK +# Setting this flag to false causes imports to not load correctly in the lettuce python files +# We do not yet understand why this occurs. Setting this to true is a stopgap measure +USE_I18N = True + # Include the lettuce app for acceptance testing, including the 'harvest' django-admin command INSTALLED_APPS += ('lettuce.django',) LETTUCE_APPS = ('contentstore',) diff --git a/cms/envs/common.py b/cms/envs/common.py index b833129737..40b8bef9ab 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -221,7 +221,7 @@ LANGUAGE_CODE = 'en' # http://www.i18nguy.com/unicode/language-identifiers.html # We want i18n to be turned off in production, at least until we have full # localizations. It's disconcerting for everything on the page to be in English # except for one or two strings like "login" which are correctly localized. -USE_I18N = DEBUG +USE_I18N = False USE_L10N = True # Localization strings (e.g. django.po) are under this directory diff --git a/cms/envs/dev.py b/cms/envs/dev.py index 6e4ce460c3..cb51ef37b1 100644 --- a/cms/envs/dev.py +++ b/cms/envs/dev.py @@ -9,6 +9,7 @@ from .common import * from logsettings import get_logger_config DEBUG = True +USE_I18N = True TEMPLATE_DEBUG = DEBUG LOGGING = get_logger_config(ENV_ROOT / "log", logging_env="dev", diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index 0914805ae2..8b5801ce23 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -102,6 +102,11 @@ CC_PROCESSOR['CyberSource']['MERCHANT_ID'] = "edx" CC_PROCESSOR['CyberSource']['SERIAL_NUMBER'] = "0123456789012345678901" CC_PROCESSOR['CyberSource']['PURCHASE_ENDPOINT'] = "/shoppingcart/payment_fake" +# HACK +# Setting this flag to false causes imports to not load correctly in the lettuce python files +# We do not yet understand why this occurs. Setting this to true is a stopgap measure +USE_I18N = True + MITX_FEATURES['ENABLE_FEEDBACK_SUBMISSION'] = True FEEDBACK_SUBMISSION_EMAIL = 'dummy@example.com' diff --git a/lms/envs/common.py b/lms/envs/common.py index 77e7bdcffb..d45f8f8521 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -458,7 +458,7 @@ LANGUAGE_CODE = 'en' # http://www.i18nguy.com/unicode/language-identifiers.html # We want i18n to be turned off in production, at least until we have full # localizations. It's disconcerting for everything on the page to be in English # except for one or two strings like "login" which are correctly localized. -USE_I18N = DEBUG +USE_I18N = False USE_L10N = True # Localization strings (e.g. django.po) are under this directory diff --git a/lms/envs/dev.py b/lms/envs/dev.py index 43b3ef5d15..4d46dc52e2 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -16,6 +16,7 @@ from .common import * from logsettings import get_logger_config DEBUG = True +USE_I18N = True TEMPLATE_DEBUG = True