Commit de3b5ad7 authored by Mandy Chen's avatar Mandy Chen Committed by Commit Bot

DevTools: Add lighthouse locale files to the audits worker module

As per the plan [1] to localize the Audits Panel, this CL adds locale
files in the lighthouse repo [2] to audits_worker/lighthouse/locales/.
The files are copied to the output folder that's uploaded to the remote
server (out/Release/resources/inspector/audits_worker/lighthouse/locales)
and they are not bundled into audits_worker_module.js. They are also not
bundled with the default (non-remote) devtools (out/Release/gen/devtools).

Screenshots: https://imgur.com/a/hZiufh4


[1]: https://docs.google.com/document/d/1jnt3BqKB-4q3AE94UWFA0Gqspx8Sd_jivlB7gQMlmfk/edit?pli=1
[2]: https://github.com/GoogleChrome/lighthouse/tree/master/lighthouse-core/lib/i18n/locales


Bug: 941561
Change-Id: I6c6572ceef6f94ebd5ff46cc17a83c21f8708221
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1784959Reviewed-by: default avatarErik Luo <luoe@chromium.org>
Reviewed-by: default avatarPaul Irish <paulirish@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#695211}
parent 26817cbe
...@@ -905,6 +905,59 @@ all_devtools_files = [ ...@@ -905,6 +905,59 @@ all_devtools_files = [
"front_end/workspace_diff/module.json", "front_end/workspace_diff/module.json",
] ]
lighthouse_locale_files = [
"front_end/audits_worker/lighthouse/locales/ar-XB.json",
"front_end/audits_worker/lighthouse/locales/ar.json",
"front_end/audits_worker/lighthouse/locales/bg.json",
"front_end/audits_worker/lighthouse/locales/ca.json",
"front_end/audits_worker/lighthouse/locales/cs.json",
"front_end/audits_worker/lighthouse/locales/da.json",
"front_end/audits_worker/lighthouse/locales/de.json",
"front_end/audits_worker/lighthouse/locales/el.json",
"front_end/audits_worker/lighthouse/locales/en-GB.json",
"front_end/audits_worker/lighthouse/locales/en-US.json",
"front_end/audits_worker/lighthouse/locales/en-XA.json",
"front_end/audits_worker/lighthouse/locales/en-XL.json",
"front_end/audits_worker/lighthouse/locales/es-419.json",
"front_end/audits_worker/lighthouse/locales/es.json",
"front_end/audits_worker/lighthouse/locales/fi.json",
"front_end/audits_worker/lighthouse/locales/fil.json",
"front_end/audits_worker/lighthouse/locales/fr.json",
"front_end/audits_worker/lighthouse/locales/he.json",
"front_end/audits_worker/lighthouse/locales/hi.json",
"front_end/audits_worker/lighthouse/locales/hr.json",
"front_end/audits_worker/lighthouse/locales/hu.json",
"front_end/audits_worker/lighthouse/locales/id.json",
"front_end/audits_worker/lighthouse/locales/it.json",
"front_end/audits_worker/lighthouse/locales/ja.json",
"front_end/audits_worker/lighthouse/locales/ko.json",
"front_end/audits_worker/lighthouse/locales/lt.json",
"front_end/audits_worker/lighthouse/locales/lv.json",
"front_end/audits_worker/lighthouse/locales/nl.json",
"front_end/audits_worker/lighthouse/locales/no.json",
"front_end/audits_worker/lighthouse/locales/pl.json",
"front_end/audits_worker/lighthouse/locales/pt-PT.json",
"front_end/audits_worker/lighthouse/locales/pt.json",
"front_end/audits_worker/lighthouse/locales/ro.json",
"front_end/audits_worker/lighthouse/locales/ru.json",
"front_end/audits_worker/lighthouse/locales/sk.json",
"front_end/audits_worker/lighthouse/locales/sl.json",
"front_end/audits_worker/lighthouse/locales/sr-Latn.json",
"front_end/audits_worker/lighthouse/locales/sr.json",
"front_end/audits_worker/lighthouse/locales/sv.json",
"front_end/audits_worker/lighthouse/locales/ta.json",
"front_end/audits_worker/lighthouse/locales/te.json",
"front_end/audits_worker/lighthouse/locales/th.json",
"front_end/audits_worker/lighthouse/locales/tr.json",
"front_end/audits_worker/lighthouse/locales/uk.json",
"front_end/audits_worker/lighthouse/locales/vi.json",
"front_end/audits_worker/lighthouse/locales/zh-HK.json",
"front_end/audits_worker/lighthouse/locales/zh-TW.json",
"front_end/audits_worker/lighthouse/locales/zh.json",
]
all_devtools_files += lighthouse_locale_files
devtools_test_files = [ devtools_test_files = [
"front_end/accessibility_test_runner/AccessibilityPaneTestRunner.js", "front_end/accessibility_test_runner/AccessibilityPaneTestRunner.js",
"front_end/accessibility_test_runner/module.json", "front_end/accessibility_test_runner/module.json",
...@@ -1226,6 +1279,7 @@ devtools_frontend_resources_deps = [ ...@@ -1226,6 +1279,7 @@ devtools_frontend_resources_deps = [
":copy_emulated_devices_images", ":copy_emulated_devices_images",
":copy_htaccess", ":copy_htaccess",
":copy_inspector_images", ":copy_inspector_images",
":copy_lighthouse_locale_files",
":devtools_extension_api", ":devtools_extension_api",
":frontend_protocol_sources", ":frontend_protocol_sources",
":supported_css_properties", ":supported_css_properties",
...@@ -1278,6 +1332,13 @@ copy("copy_emulated_devices_images") { ...@@ -1278,6 +1332,13 @@ copy("copy_emulated_devices_images") {
] ]
} }
copy("copy_lighthouse_locale_files") {
sources = lighthouse_locale_files
outputs = [
"$resources_out_dir/audits_worker/lighthouse/locales/{{source_file_part}}",
]
}
action("generate_devtools_grd") { action("generate_devtools_grd") {
script = "scripts/build/generate_devtools_grd.py" script = "scripts/build/generate_devtools_grd.py"
...@@ -1292,7 +1353,8 @@ action("generate_devtools_grd") { ...@@ -1292,7 +1353,8 @@ action("generate_devtools_grd") {
# Bundle remote modules in ChromeOS. # Bundle remote modules in ChromeOS.
if (is_chromeos) { if (is_chromeos) {
grd_files += generated_remote_modules + devtools_emulated_devices_images grd_files += generated_remote_modules + devtools_emulated_devices_images +
lighthouse_locale_files
} }
inputs = grd_files + devtools_image_files inputs = grd_files + devtools_image_files
......
...@@ -6,3 +6,7 @@ Security Critical: no ...@@ -6,3 +6,7 @@ Security Critical: no
This directory contains Chromium's version of lighthouse with tests, demo and sources removed. This directory contains Chromium's version of lighthouse with tests, demo and sources removed.
The locales/ folder is not bundled with audits_worker_module.js. Instead, the files are hosted separately
on the remote server. The appropriate locale file will be fetched and its content registered with lighthouse
before running audits.
More info on the lighthouse localization process: https://docs.google.com/document/d/1jnt3BqKB-4q3AE94UWFA0Gqspx8Sd_jivlB7gQMlmfk/edit
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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