Make the platform name translatable
This commit is contained in:
committed by
Alex Dusenbery
parent
167e4d582f
commit
d0c7a532ad
@@ -246,9 +246,9 @@ LOGGING = get_logger_config(LOG_DIR,
|
||||
service_variant=SERVICE_VARIANT)
|
||||
|
||||
#theming start:
|
||||
PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', 'edX')
|
||||
STUDIO_NAME = ENV_TOKENS.get('STUDIO_NAME', 'edX Studio')
|
||||
STUDIO_SHORT_NAME = ENV_TOKENS.get('STUDIO_SHORT_NAME', 'Studio')
|
||||
PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', PLATFORM_NAME)
|
||||
STUDIO_NAME = ENV_TOKENS.get('STUDIO_NAME', STUDIO_NAME)
|
||||
STUDIO_SHORT_NAME = ENV_TOKENS.get('STUDIO_SHORT_NAME', STUDIO_SHORT_NAME)
|
||||
|
||||
# Event Tracking
|
||||
if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS:
|
||||
|
||||
@@ -65,6 +65,9 @@ from lms.envs.common import (
|
||||
MEDIA_ROOT,
|
||||
MEDIA_URL,
|
||||
|
||||
# Lazy Gettext
|
||||
_,
|
||||
|
||||
# Django REST framework configuration
|
||||
REST_FRAMEWORK,
|
||||
|
||||
@@ -125,8 +128,8 @@ from openedx.core.lib.license import LicenseMixin
|
||||
# Dummy secret key for dev/test
|
||||
SECRET_KEY = 'dev key'
|
||||
|
||||
STUDIO_NAME = "Studio"
|
||||
STUDIO_SHORT_NAME = "Studio"
|
||||
STUDIO_NAME = _("Your Platform Studio")
|
||||
STUDIO_SHORT_NAME = _("Studio")
|
||||
FEATURES = {
|
||||
'GITHUB_PUSH': False,
|
||||
|
||||
|
||||
@@ -51,14 +51,6 @@ _PSA_OAUTH2_BACKENDS = [backend_class.name for backend_class in _load_backend_cl
|
||||
_PSA_SAML_BACKENDS = [backend_class.name for backend_class in _load_backend_classes(SAMLAuth)]
|
||||
_LTI_BACKENDS = [backend_class.name for backend_class in _load_backend_classes(LTIAuthBackend)]
|
||||
|
||||
DEFAULT_SAML_CONTACT = {
|
||||
# Default contact information to put into the SAML metadata that gets generated by python-saml.
|
||||
"givenName": u"{} Support".format(
|
||||
configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
|
||||
),
|
||||
"emailAddress": configuration_helpers.get_value('TECH_SUPPORT_EMAIL', settings.TECH_SUPPORT_EMAIL),
|
||||
}
|
||||
|
||||
|
||||
def clean_json(value, of_type):
|
||||
""" Simple helper method to parse and clean JSON """
|
||||
@@ -576,6 +568,14 @@ class SAMLConfiguration(ConfigurationModel):
|
||||
|
||||
def get_setting(self, name):
|
||||
""" Get the value of a setting, or raise KeyError """
|
||||
default_saml_contact = {
|
||||
# Default contact information to put into the SAML metadata that gets generated by python-saml.
|
||||
"givenName": _("{platform_name} Support").format(
|
||||
platform_name=configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
|
||||
),
|
||||
"emailAddress": configuration_helpers.get_value('TECH_SUPPORT_EMAIL', settings.TECH_SUPPORT_EMAIL),
|
||||
}
|
||||
|
||||
if name == "ORG_INFO":
|
||||
return json.loads(self.org_info_str)
|
||||
if name == "SP_ENTITY_ID":
|
||||
@@ -593,8 +593,8 @@ class SAMLConfiguration(ConfigurationModel):
|
||||
other_config = {
|
||||
# These defaults can be overriden by self.other_config_str
|
||||
"GET_ALL_EXTRA_DATA": True, # Save all attribute values the IdP sends into the UserSocialAuth table
|
||||
"TECHNICAL_CONTACT": DEFAULT_SAML_CONTACT,
|
||||
"SUPPORT_CONTACT": DEFAULT_SAML_CONTACT,
|
||||
"TECHNICAL_CONTACT": default_saml_contact,
|
||||
"SUPPORT_CONTACT": default_saml_contact,
|
||||
}
|
||||
other_config.update(json.loads(self.other_config_str))
|
||||
return other_config[name] # SECURITY_CONFIG, SP_EXTRA, or similar extra settings
|
||||
|
||||
@@ -179,7 +179,7 @@ class HomeHelpTest(StudioCourseTest):
|
||||
Scenario: Help link in sidebar links is working on 'Home'(Courses tab) page.
|
||||
Given that I am on the 'Home'(Courses tab) page.
|
||||
And I want help about the courses
|
||||
And I click the 'Getting Started with edX Studio' in the sidebar links
|
||||
And I click the 'Getting Started with Your Platform Studio' in the sidebar links
|
||||
Then Help link should open.
|
||||
And help url should be correct
|
||||
"""
|
||||
@@ -190,7 +190,7 @@ class HomeHelpTest(StudioCourseTest):
|
||||
test=self,
|
||||
page=self.home_page,
|
||||
href=expected_url,
|
||||
help_text='Getting Started with edX Studio',
|
||||
help_text='Getting Started with Your Platform Studio',
|
||||
as_list_item=True
|
||||
)
|
||||
|
||||
@@ -232,7 +232,7 @@ class NewCourseHelpTest(AcceptanceTest):
|
||||
Scenario: Help link in sidebar links is working on 'Create a New Course' page in the dashboard.
|
||||
Given that I am on the 'Create a New Course' page in the dashboard.
|
||||
And I want help about the process
|
||||
And I click the 'Getting Started with edX Studio' in the sidebar links
|
||||
And I click the 'Getting Started with Your Platform Studio' in the sidebar links
|
||||
Then Help link should open.
|
||||
And help url should be correct
|
||||
"""
|
||||
@@ -243,7 +243,7 @@ class NewCourseHelpTest(AcceptanceTest):
|
||||
test=self,
|
||||
page=self.dashboard_page,
|
||||
href=expected_url,
|
||||
help_text='Getting Started with edX Studio',
|
||||
help_text='Getting Started with Your Platform Studio',
|
||||
as_list_item=True
|
||||
)
|
||||
|
||||
@@ -285,7 +285,7 @@ class NewLibraryHelpTest(AcceptanceTest):
|
||||
Scenario: Help link in sidebar links is working on 'Create a New Library' page in the dashboard.
|
||||
Given that I am on the 'Create a New Library' page in the dashboard.
|
||||
And I want help about the process
|
||||
And I click the 'Getting Started with edX Studio' in the sidebar links
|
||||
And I click the 'Getting Started with Your Platform Studio' in the sidebar links
|
||||
Then Help link should open.
|
||||
And help url should be correct
|
||||
"""
|
||||
@@ -296,7 +296,7 @@ class NewLibraryHelpTest(AcceptanceTest):
|
||||
test=self,
|
||||
page=self.dashboard_page,
|
||||
href=expected_url,
|
||||
help_text='Getting Started with edX Studio',
|
||||
help_text='Getting Started with Your Platform Studio',
|
||||
as_list_item=True
|
||||
)
|
||||
|
||||
|
||||
@@ -581,7 +581,7 @@ if 'DATADOG_API' in AUTH_TOKENS:
|
||||
|
||||
# Analytics Dashboard
|
||||
ANALYTICS_DASHBOARD_URL = ENV_TOKENS.get("ANALYTICS_DASHBOARD_URL", ANALYTICS_DASHBOARD_URL)
|
||||
ANALYTICS_DASHBOARD_NAME = ENV_TOKENS.get("ANALYTICS_DASHBOARD_NAME", PLATFORM_NAME + " Insights")
|
||||
ANALYTICS_DASHBOARD_NAME = ENV_TOKENS.get("ANALYTICS_DASHBOARD_NAME", ANALYTICS_DASHBOARD_NAME)
|
||||
|
||||
# Mailchimp New User List
|
||||
MAILCHIMP_NEW_USER_LIST_ID = ENV_TOKENS.get("MAILCHIMP_NEW_USER_LIST_ID")
|
||||
|
||||
@@ -45,7 +45,7 @@ from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
|
||||
|
||||
################################### FEATURES ###################################
|
||||
# The display name of the platform to be used in templates/emails/etc.
|
||||
PLATFORM_NAME = "Your Platform Name Here"
|
||||
PLATFORM_NAME = _('Your Platform Name Here')
|
||||
CC_MERCHANT_NAME = PLATFORM_NAME
|
||||
|
||||
PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/YourPlatformFacebookAccount"
|
||||
@@ -2852,7 +2852,7 @@ OPENID_DOMAIN_PREFIX = 'openid:'
|
||||
|
||||
### Analytics Dashboard (Insights) settings
|
||||
ANALYTICS_DASHBOARD_URL = ""
|
||||
ANALYTICS_DASHBOARD_NAME = PLATFORM_NAME + " Insights"
|
||||
ANALYTICS_DASHBOARD_NAME = _('Your Platform Insights')
|
||||
|
||||
# REGISTRATION CODES DISPLAY INFORMATION SUBTITUTIONS IN THE INVOICE ATTACHMENT
|
||||
INVOICE_CORP_ADDRESS = "Please place your corporate address\nin this configuration"
|
||||
|
||||
@@ -15,7 +15,6 @@ DEBUG = True
|
||||
USE_I18N = True
|
||||
DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = True
|
||||
SITE_NAME = 'localhost:8000'
|
||||
PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', 'Devstack')
|
||||
# By default don't use a worker, execute tasks as if they were local functions
|
||||
CELERY_ALWAYS_EAGER = True
|
||||
HTTPS = 'off'
|
||||
|
||||
Reference in New Issue
Block a user