Skip to content

Commit a29bee8

Browse files
authored
fix: Svelte regex wrong first capturing group (#1003) (#1013)
According to https://github.com/lokalise/i18n-ally/wiki/Custom-Framework `({key})` in regex should be first capturing group.
1 parent d5e0c48 commit a29bee8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/frameworks/svelte.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class SvelteFramework extends Framework {
2323

2424
// for visualize the regex, you can use https://regexper.com/
2525
usageMatchRegex = [
26-
'(\\$(_|t|format)|(get)\\(\\s*(_|t|format)\\s*\\))\\(\\s*[\'"`]({key})[\'"`]',
26+
'(?:\\$(?:_|t|format)|(?:get)\\(\\s*(?:_|t|format)\\s*\\))\\(\\s*[\'"`]({key})[\'"`]',
2727
]
2828

2929
refactorTemplates(keypath: string) {

0 commit comments

Comments
 (0)