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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/frameworks/svelte.ts

Lines changed: 1 addition & 1 deletion
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)