DevTools: Add scripts to generate id mapping for localizable strings
The backend changes[1] for localizing devtools leverage the existing webui functionalities, which consume a list of id mappings from the id of a string used in the frontend (i.e. the English string) to the IDS_ key of the string in the corresponding grdp file. Example: const LocalizedString kLocalizedStrings[] = { ... {"Editable", IDS_DEVTOOLS_2c09e798bf8c5a82d211331c82893a0f}, ... } This patch adds scripts that generate the structure. The output will be two files, devtools_ui_strings_map.h and .cc, under <generated files root directory>/chrome/browser/ui/webui (e.g. D:/chromium/src/out/Release/gen/chrome/browser/ui/webui). The design is to create a build step that calls generate_devtools_ui_strings.py, which then calls generate_devtools_ui_strings.js. Integration into the build system will come as a another patch, because it depends on the first set of changes[2]. Example arguments to generate_devtools_ui_strings.js to generate output files (invoke under '--root_gen_dir', e.g. D:/chromium/src/out/release/gen in the example below): ['D:/chromium/src/third_party/node/win/node.exe', 'D:/chromium/src/third_party/blink/renderer/devtools/scripts/build/generate_devtools_ui_strings.js', '--root_gen_dir', 'D:/chromium/src/out/release/gen', '--output_header', 'chrome/browser/ui/webui/devtools_ui_strings_map.h', '--output_cc', 'chrome/browser/ui/webui/devtools_ui_strings_map.cc'] [1]: https://crrev.com/c/1672628 [2]: https://crrev.com/c/1628927 Bug: 941561 Change-Id: Ic03dae24cd074219790c6eec5df3183c24bf15a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671848Reviewed-by:Yang Guo <yangguo@chromium.org> Commit-Queue: Mandy Chen <mandy.chen@microsoft.com> Cr-Commit-Position: refs/heads/master@{#699370}
Showing
Please register or sign in to comment