diff --git a/cms/djangoapps/models/settings/course_metadata.py b/cms/djangoapps/models/settings/course_metadata.py index 32f9daa6da..da341e6a74 100644 --- a/cms/djangoapps/models/settings/course_metadata.py +++ b/cms/djangoapps/models/settings/course_metadata.py @@ -140,10 +140,16 @@ class CourseMetadata(object): for field in descriptor.fields.values(): if field.scope != Scope.settings: continue + + field_help = _(field.help) # pylint: disable=translation-of-non-string + help_args = field.runtime_options.get('help_format_args') + if help_args is not None: + field_help = field_help.format(**help_args) + result[field.name] = { 'value': field.read_json(descriptor), 'display_name': _(field.display_name), # pylint: disable=translation-of-non-string - 'help': _(field.help), # pylint: disable=translation-of-non-string + 'help': field_help, 'deprecated': field.runtime_options.get('deprecated', False) } return result diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 9f1bba916f..591e5bcd7f 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -732,7 +732,8 @@ class CourseFields(object): 'For example, to specify that teams should have a maximum of 5 participants and provide a list of ' '2 topics, enter the configuration in this format: {example_format}. ' 'In "id" values, the only supported special characters are underscore, hyphen, and period.' - ).format( + ), + help_format_args=dict( # Put the sample JSON into a format variable so that translators # don't muck with it. example_format=( diff --git a/common/lib/xmodule/xmodule/modulestore/inheritance.py b/common/lib/xmodule/xmodule/modulestore/inheritance.py index 91c2811b35..156fe89f0c 100644 --- a/common/lib/xmodule/xmodule/modulestore/inheritance.py +++ b/common/lib/xmodule/xmodule/modulestore/inheritance.py @@ -178,7 +178,8 @@ class InheritanceMixin(XBlockMixin): "Identify a video, 5-10 seconds in length, to play before course videos. Enter the video ID from " "the Video Uploads page and one or more transcript files in the following format: {format}. " "For example, an entry for a video with two transcripts looks like this: {example}" - ).format( + ), + help_format_args=dict( format='{"video_id": "ID", "transcripts": {"language": "/static/filename.srt"}}', example=( '{'