diff --git a/cms/devstack.yml b/cms/devstack.yml index 109e9c8a3902..497d73bf492d 100644 --- a/cms/devstack.yml +++ b/cms/devstack.yml @@ -383,6 +383,7 @@ PLATFORM_FACEBOOK_ACCOUNT: http://www.facebook.com/YourPlatformFacebookAccount PLATFORM_NAME: Your Platform Name Here PLATFORM_TWITTER_ACCOUNT: '@YourPlatformTwitterAccount' POLICY_CHANGE_GRADES_ROUTING_KEY: edx.lms.core.default +PREPEND_LOCALE_PATHS: [] PRESS_EMAIL: press@example.com PROCTORING_BACKENDS: DEFAULT: 'null' diff --git a/cms/envs/common.py b/cms/envs/common.py index c94d663f7816..6209e4e6c3b9 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1965,6 +1965,12 @@ # "COMPREHENSIVE_THEME_LOCALE_PATHS" : ["/edx/src/edx-themes/conf/locale"]. COMPREHENSIVE_THEME_LOCALE_PATHS = [] +# .. setting_name: PREPEND_LOCALE_PATHS +# .. setting_default: [] +# .. setting_description: A list of the paths to locale directories to load first e.g. +# "PREPEND_LOCALE_PATHS" : ["/edx/my-locales/"]. +PREPEND_LOCALE_PATHS = [] + # .. setting_name: DEFAULT_SITE_THEME # .. setting_default: None # .. setting_description: See LMS annotation. diff --git a/cms/envs/production.py b/cms/envs/production.py index 6bc60b1d4ea5..58cc25401c92 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -233,6 +233,12 @@ def get_env_setting(setting): # ], COMPREHENSIVE_THEME_LOCALE_PATHS = ENV_TOKENS.get('COMPREHENSIVE_THEME_LOCALE_PATHS', []) +# PREPEND_LOCALE_PATHS contain the paths to locale directories to load first e.g. +# "PREPEND_LOCALE_PATHS" : [ +# "/edx/my-locale/" +# ], +PREPEND_LOCALE_PATHS = ENV_TOKENS.get('PREPEND_LOCALE_PATHS', []) + #Timezone overrides TIME_ZONE = ENV_TOKENS.get('CELERY_TIMEZONE', CELERY_TIMEZONE) diff --git a/lms/devstack.yml b/lms/devstack.yml index 0e71b134cfef..da3437eb998c 100644 --- a/lms/devstack.yml +++ b/lms/devstack.yml @@ -449,6 +449,7 @@ PLATFORM_FACEBOOK_ACCOUNT: http://www.facebook.com/YourPlatformFacebookAccount PLATFORM_NAME: Your Platform Name Here PLATFORM_TWITTER_ACCOUNT: '@YourPlatformTwitterAccount' POLICY_CHANGE_GRADES_ROUTING_KEY: edx.lms.core.default +PREPEND_LOCALE_PATHS: [] PRESS_EMAIL: press@example.com PROCTORING_BACKENDS: DEFAULT: 'null' diff --git a/lms/envs/common.py b/lms/envs/common.py index 3ccb04ab601c..f3d8e4ea219b 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1816,7 +1816,9 @@ def _make_mako_template_dirs(settings): # Localization strings (e.g. django.po) are under these directories def _make_locale_paths(settings): # pylint: disable=missing-function-docstring - locale_paths = [settings.REPO_ROOT + '/conf/locale'] # edx-platform/conf/locale/ + locale_paths = list(settings.PREPEND_LOCALE_PATHS) + locale_paths += [settings.REPO_ROOT + '/conf/locale'] # edx-platform/conf/locale/ + if settings.ENABLE_COMPREHENSIVE_THEMING: # Add locale paths to settings for comprehensive theming. for locale_path in settings.COMPREHENSIVE_THEME_LOCALE_PATHS: @@ -4275,6 +4277,13 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring # "COMPREHENSIVE_THEME_LOCALE_PATHS" : ["/edx/src/edx-themes/conf/locale"]. COMPREHENSIVE_THEME_LOCALE_PATHS = [] + +# .. setting_name: PREPEND_LOCALE_PATHS +# .. setting_default: [] +# .. setting_description: A list of the paths to locale directories to load first e.g. +# "PREPEND_LOCALE_PATHS" : ["/edx/my-locales/"]. +PREPEND_LOCALE_PATHS = [] + # .. setting_name: DEFAULT_SITE_THEME # .. setting_default: None # .. setting_description: Theme to use when no site or site theme is defined, for example diff --git a/lms/envs/production.py b/lms/envs/production.py index d7f934822dfc..84f3e676aac8 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -268,6 +268,13 @@ def get_env_setting(setting): COMPREHENSIVE_THEME_LOCALE_PATHS = ENV_TOKENS.get('COMPREHENSIVE_THEME_LOCALE_PATHS', []) +# PREPEND_LOCALE_PATHS contain the paths to locale directories to load first e.g. +# "PREPEND_LOCALE_PATHS" : [ +# "/edx/my-locale" +# ], +PREPEND_LOCALE_PATHS = ENV_TOKENS.get('PREPEND_LOCALE_PATHS', []) + + MKTG_URL_LINK_MAP.update(ENV_TOKENS.get('MKTG_URL_LINK_MAP', {})) ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS = ENV_TOKENS.get( 'ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS', diff --git a/lms/envs/test.py b/lms/envs/test.py index 78bab93ec672..cf16eb38116b 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -477,6 +477,8 @@ COMPREHENSIVE_THEME_LOCALE_PATHS = [REPO_ROOT / "themes/conf/locale", ] ENABLE_COMPREHENSIVE_THEMING = True +PREPEND_LOCALE_PATHS = [] + LMS_ROOT_URL = "http://localhost:8000" # Needed for derived settings used by cms only.