Previously we did not iterate subdirectories which meant we missed
folders like ui/components. Now the script complains that there is no
appropriate .grdp file for the strings it finds in e.g. SurveyLink.ts.
Also add the missing strings for SurveyLink.ts as the script now finds
them.
Bug: 1169118
Change-Id: I0e4793dc8581cd439f103632e60e9b8088a529a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2644811
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
This check will detect (and autofix) any string resources that are not used in the code anymore. If a developer deletes a localization call but forgets to delete it from the UIStrings structure, the check will warn/remove it.
Testing steps
1. Add the following to the CoverageView.js right after import statements
export const UIStrings = {
/**
*@description Text in Coverage List View of the Coverage tab
*/
perFunction: 'Per function',
/**
*@description Text in Coverage List View of the Coverage tab
*/
perBlock: 'Per block',
};
2. Change:
label: ls`Per function`,
To the Loc V2 API call:
label: i18n.i18n.getLocalizedString(str_, UIStrings.perFunction),
3. Change:
label: ls`Per block`,
To not use any localization API
label: "Per block",
4. Run
node check_localizable_resources.js --autofix
The Loc V1 check would remove the two entries from grdp
The Loc V2 check would remove perBlock entry from UIStrings
See Loc design doc #Presubmit section for details
https://docs.google.com/document/d/1L6TkT2-42MMQ72ZSBMFwUaq7M6mDgA2X0x8oHHKaV_U/edit#heading=h.w1no7qaa0mi0
Bug: 941561
Change-Id: Ic5f3ee6e9c1586bb3226593c32bc7af7e49a547a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2236544
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>