Skip to content

Commit 1b9948a

Browse files
committed
fix: find locale params in render calls
1 parent 2322356 commit 1b9948a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/utilities/locales.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ function extractStorefrontTranslationKeys(content: string): Set<string> {
148148
}
149149
}
150150

151+
// Find all locale: parameters in any render call
152+
const localePattern = /render\s+["'][^"']+["'][\S\s]*?locale:\s*["']([^"']+)["']/g
153+
const localeMatches = [...content.matchAll(localePattern)]
154+
for (const match of localeMatches) {
155+
keys.add(match[1])
156+
}
157+
151158
// Combine with utility.translate translations
152159
return new Set([...keys, ...extractUtilityTranslateKeys(content)])
153160
}

0 commit comments

Comments
 (0)