feat: add PREPEND_LOCALE_PATHS configuration setting (#29851)
edx-platform supports COMPREHENSIVE_THEME_LOCALE_PATHS setting, which appends paths to the end of LOCALE_PATHS, but there's currently no way to add additional paths to the start of the list. https://tasks.opencraft.com/browse/SE-5299
This commit is contained in:
@@ -2026,6 +2026,12 @@ COMPREHENSIVE_THEME_DIRS = []
|
||||
# "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.
|
||||
|
||||
@@ -415,6 +415,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'
|
||||
|
||||
@@ -247,6 +247,12 @@ COURSES_WITH_UNSAFE_CODE = ENV_TOKENS.get("COURSES_WITH_UNSAFE_CODE", [])
|
||||
# ],
|
||||
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)
|
||||
|
||||
|
||||
@@ -1848,7 +1848,9 @@ STATICI18N_OUTPUT_DIR = "js/i18n"
|
||||
|
||||
# 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:
|
||||
@@ -4365,6 +4367,13 @@ COMPREHENSIVE_THEME_DIRS = []
|
||||
# "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
|
||||
|
||||
@@ -484,6 +484,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'
|
||||
|
||||
@@ -279,6 +279,13 @@ if ENV_TOKENS.get('COMPREHENSIVE_THEME_DIR', None):
|
||||
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',
|
||||
|
||||
@@ -477,6 +477,8 @@ COMPREHENSIVE_THEME_DIRS = [REPO_ROOT / "themes", REPO_ROOT / "common/test"]
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user