Make collect-strings work with .ts files

The current collect-strings only scan .js file extension. This CL enables string collecting in .ts files.

Bug: 1136655
Change-Id: Ia6b4aa364496a80288edad49a471017923f71f05
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2575514
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
This commit is contained in:
Christy Chen
2020-12-09 18:27:57 +00:00
committed by Commit Bot
parent 87d9ffc323
commit bbdf7342fe
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -16,3 +16,4 @@ Local Modifications:
4. Remove pruneObsoleteLhlMessages() and check collisions step
5. Implement getToken() to avoid requiring the exportVars (liveUIStrings) due to ESM limitation in collectAllStringsInDir()
6. Remove backtick for locked term after converting it to placeholder in ctc.json
7. Enable the scanning of files with .ts extensions
+1 -1
View File
@@ -561,7 +561,7 @@ function collectAllStringsInDir(dir) {
/** @type {Record<string, CtcMessage>} */
const strings = {};
const globPattern = path.join(path.relative(SRC_ROOT, dir), '/**/*.js');
const globPattern = path.join(path.relative(SRC_ROOT, dir), '/**/*.{js,ts}');
const files = glob.sync(globPattern, {
cwd: SRC_ROOT,
ignore: ignoredPathComponents,