From 1b9948a30150fbe2146ef895a3528dbc43745fea Mon Sep 17 00:00:00 2001 From: Chris Berthe Date: Fri, 25 Apr 2025 11:53:34 -0400 Subject: [PATCH] fix: find locale params in render calls --- src/utilities/locales.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utilities/locales.ts b/src/utilities/locales.ts index eabb1cf..b5f42bc 100644 --- a/src/utilities/locales.ts +++ b/src/utilities/locales.ts @@ -148,6 +148,13 @@ function extractStorefrontTranslationKeys(content: string): Set { } } + // Find all locale: parameters in any render call + const localePattern = /render\s+["'][^"']+["'][\S\s]*?locale:\s*["']([^"']+)["']/g + const localeMatches = [...content.matchAll(localePattern)] + for (const match of localeMatches) { + keys.add(match[1]) + } + // Combine with utility.translate translations return new Set([...keys, ...extractUtilityTranslateKeys(content)]) }