This directory contains tools for Chrome's UI translations.
This tool uploads translation screenshots to a content-addressed Google Cloud Storage bucket.
Translation screenshots are .png files provided by Chrome Developers to give translators more context about UI changes. Developers take screenshots of their UI changes, add them under a specific directory derived from the path of the .grd or .grdp file that contains the UI string and run this tool. The tool uploads the images, generates SHA1 hashes of them, and asks the developer if they want to add the hashes to the CL.
Example: For a file at path/to/test.grd
, the screenshot directory will be
path/to/test_grd
. In the upstream Chrome repository, this directory will only
contain .png.sha1
files previously generated by this tool. In local working
repositories, it may contain .png
files generated by Chrome developers, such as
path/to/test_grd/IDS_MESSAGE.png
.
For more information, see https://g.co/chrome/translation.
The presubmit automatically runs all files named *_unittest.py
:
git cl presubmit --force
Alternatively, you can run each test individually:
# Run from this directory (//tools/translation):
python helper/grd_helper_unittest.py
python helper/translation_helper_unittest.py
python upload_screenshots_unittest.py
This will attempt to load all .grd and .grdp files in the Chrome repo. Run once before uploading the CL to ensure everything works.
python helper/sanity_check.py
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。