XBlock fields with formatted-in values can now translate properly
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user