Commit 5d6485d1 authored by Jeffrey Cohen's avatar Jeffrey Cohen Committed by Commit Bot

[l10n] Adds an internal clank option to the upload screenshot tool.

The upload screenshot tool now optionally captures screenshots
for translated strings in the downstream clank directory. This allows
engineers who are adding strings to features located in the clank
directory to integrate with the existing translation tooling.

Bug: 1122780
Change-Id: I348caf20c09cf22a0924d154ef4bdcc7902e70af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380328Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802732}
parent 9c314f83
...@@ -38,6 +38,10 @@ import download_from_google_storage ...@@ -38,6 +38,10 @@ import download_from_google_storage
sys.path.remove(depot_tools_path) sys.path.remove(depot_tools_path)
# Translation expectations file for the clank repo.
INTERNAL_TRANSLATION_EXPECTATIONS_PATH = os.path.join(
'clank', 'tools', 'translation_expectations.pyl')
# Translation expectations file for the Chromium repo. # Translation expectations file for the Chromium repo.
TRANSLATION_EXPECTATIONS_PATH = os.path.join('tools', 'gritsettings', TRANSLATION_EXPECTATIONS_PATH = os.path.join('tools', 'gritsettings',
'translation_expectations.pyl') 'translation_expectations.pyl')
...@@ -131,11 +135,20 @@ def main(): ...@@ -131,11 +135,20 @@ def main():
'--dry-run', '--dry-run',
action='store_true', action='store_true',
help='Don\'t actually upload the images') help='Don\'t actually upload the images')
parser.add_argument(
'-c',
'--clank_internal',
action='store_true',
help='Upload screenshots for strings in the downstream clank directory')
args = parser.parse_args() args = parser.parse_args()
if args.clank_internal:
screenshots = find_screenshots(
os.path.join(src_path, "clank"),
os.path.join(src_path, INTERNAL_TRANSLATION_EXPECTATIONS_PATH))
screenshots = find_screenshots(src_path, else:
os.path.join(src_path, screenshots = find_screenshots(
TRANSLATION_EXPECTATIONS_PATH)) src_path, os.path.join(src_path, TRANSLATION_EXPECTATIONS_PATH))
if not screenshots: if not screenshots:
print ("No screenshots found.\n\n" print ("No screenshots found.\n\n"
"- Screenshots must be located in the correct directory.\n" "- Screenshots must be located in the correct directory.\n"
......
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