Commit c8a012d0 authored by Mustafa Emre Acer's avatar Mustafa Emre Acer Committed by Commit Bot

Tweak the presubmit message for translation screenshots

Bug: 872199
Change-Id: I4e7a409ff20819d682e5f7e9415e126563e353ef
Reviewed-on: https://chromium-review.googlesource.com/1155922Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579241}
parent 33202277
......@@ -3458,17 +3458,17 @@ def _CheckTranslationScreenshots(input_api, output_api):
if file_path.endswith('.grdp'):
if f.OldContents():
old_id_to_msg_map = _GetGrdpMessagesFromString(
unicode("\n".join(f.OldContents())))
unicode('\n'.join(f.OldContents())))
if f.NewContents():
new_id_to_msg_map = _GetGrdpMessagesFromString(
unicode("\n".join(f.NewContents())))
unicode('\n'.join(f.NewContents())))
else:
if f.OldContents():
old_id_to_msg_map = _GetGrdMessages(
StringIO(unicode("\n".join(f.OldContents()))))
StringIO(unicode('\n'.join(f.OldContents()))))
if f.NewContents():
new_id_to_msg_map = _GetGrdMessages(
StringIO(unicode("\n".join(f.NewContents()))))
StringIO(unicode('\n'.join(f.NewContents()))))
# Compute added, removed and modified message IDs.
old_ids = set(old_id_to_msg_map)
......@@ -3503,20 +3503,20 @@ def _CheckTranslationScreenshots(input_api, output_api):
results = []
if unnecessary_screenshots:
results.append(output_api.PresubmitNotifyResult(
"Do not include actual screenshots in the CL. Run "
"tools/translate/upload_screenshots to upload them instead",
'Do not include actual screenshots in the changelist. Run '
'tools/translate/upload_screenshots.py to upload them instead:',
sorted(unnecessary_screenshots)))
if missing_sha1:
results.append(output_api.PresubmitNotifyResult(
"You are adding or modifying UI messages. Add screenshots "
"and run tools/translate/upload_screenshots to generate and add these "
"files to the CL:",
sorted(missing_sha1)))
'You are adding or modifying UI strings.\n'
'To ensure the best translations, take screenshots of the relevant UI '
'(https://g.co/chrome/translation) and add these files to your '
'changelist:', sorted(missing_sha1)))
if unnecessary_sha1_files:
results.append(output_api.PresubmitNotifyResult(
"You removed messages associated with these files. Consider removing:",
'You removed strings associated with these files. Remove:',
sorted(unnecessary_sha1_files)))
return results
......@@ -1881,15 +1881,17 @@ class TranslationScreenshotsTest(unittest.TestCase):
</grit>
""".splitlines()
DO_NOT_UPLOAD_PNG_MESSAGE = ("Do not include actual screenshots in the CL. "
"Run tools/translate/upload_screenshots to "
"upload them instead")
GENERATE_SIGNATURES_MESSAGE = ("You are adding or modifying UI messages. "
"Add screenshots and run "
"tools/translate/upload_screenshots to "
"generate and add these files to the CL:")
REMOVE_SIGNATURES_MESSAGE = ("You removed messages associated with these "
"files. Consider removing:")
DO_NOT_UPLOAD_PNG_MESSAGE = ('Do not include actual screenshots in the '
'changelist. Run '
'tools/translate/upload_screenshots.py to '
'upload them instead:')
GENERATE_SIGNATURES_MESSAGE = ('You are adding or modifying UI strings.\n'
'To ensure the best translations, take '
'screenshots of the relevant UI '
'(https://g.co/chrome/translation) and add '
'these files to your changelist:')
REMOVE_SIGNATURES_MESSAGE = ('You removed strings associated with these '
'files. Remove:')
def makeInputApi(self, files):
input_api = MockInputApi()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment