Merge pull request #7563 from louyihua/translation_fix

Ignore pylint error 7610 (translation-of-non-string) on where it is intended
This commit is contained in:
Sarina Canelake
2015-04-03 08:47:36 -04:00
8 changed files with 15 additions and 15 deletions

View File

@@ -132,12 +132,12 @@ def localize_checklist_text(checklist):
The method does an in-place operation so the input checklist is modified directly.
"""
# Localize checklist name
checklist['short_description'] = ugettext(checklist['short_description'])
checklist['short_description'] = ugettext(checklist['short_description']) # pylint: disable=translation-of-non-string
# Localize checklist items
for item in checklist.get('items'):
item['short_description'] = ugettext(item['short_description'])
item['long_description'] = ugettext(item['long_description'])
item['action_text'] = ugettext(item['action_text'])
item['short_description'] = ugettext(item['short_description']) # pylint: disable=translation-of-non-string
item['long_description'] = ugettext(item['long_description']) # pylint: disable=translation-of-non-string
item['action_text'] = ugettext(item['action_text']) # pylint: disable=translation-of-non-string
return checklist

View File

@@ -279,7 +279,7 @@ def get_component_templates(courselike, library=False):
if not filter_templates or filter_templates(template, courselike):
templates_for_category.append(
create_template_dict(
_(template['metadata'].get('display_name')),
_(template['metadata'].get('display_name')), # pylint: disable=translation-of-non-string
category,
template.get('template_id'),
template['metadata'].get('markdown') is not None

View File

@@ -73,7 +73,7 @@ class StatusDisplayStrings(object):
@staticmethod
def get(val_status):
"""Map a VAL status string to a localized display string"""
return _(StatusDisplayStrings._STATUS_MAP.get(val_status, StatusDisplayStrings._UNKNOWN))
return _(StatusDisplayStrings._STATUS_MAP.get(val_status, StatusDisplayStrings._UNKNOWN)) # pylint: disable=translation-of-non-string
@expect_json

View File

@@ -96,8 +96,8 @@ class CourseMetadata(object):
continue
result[field.name] = {
'value': field.read_json(descriptor),
'display_name': _(field.display_name),
'help': _(field.help),
'display_name': _(field.display_name), # pylint: disable=translation-of-non-string
'help': _(field.help), # pylint: disable=translation-of-non-string
'deprecated': field.runtime_options.get('deprecated', False)
}
return result