Skip to content

Commit 109a224

Browse files
committed
fix(i18n): address interpolation checker review findings
1 parent 49c001f commit 109a224

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/check-i18n-interpolation.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Usage: node scripts/check-i18n-interpolation.js
66
*
7-
* Only calls with a string-literal key and no second argument or an object-literal one are checked.
7+
* Only calls with a string-literal key and an object-literal second argument are checked.
88
* A spread in the object skips the call.
99
*/
1010

@@ -30,7 +30,7 @@ const files = execFileSync(
3030
const resources = {}
3131
function getResource(pkg, ns) {
3232
// A namespace is a locale file name. Reject anything that could leave the locale directory.
33-
if (!/^[\w-]+$/.test(ns)) return undefined
33+
if (!/^[\w.-]+$/.test(ns)) return undefined
3434
const id = `${pkg}:${ns}`
3535
if (!(id in resources)) {
3636
const file = path.join(ROOT, pkg === "src" ? "src" : "webview-ui/src", "i18n/locales/en", `${ns}.json`)

0 commit comments

Comments
 (0)