Skip to content

Commit

Permalink
fix: Svelte regex wrong first capturing group (#1003) (#1013)
Browse files Browse the repository at this point in the history
According to https://github.com/lokalise/i18n-ally/wiki/Custom-Framework `({key})` in regex should be first capturing group.
  • Loading branch information
ZerdoX-x authored Sep 23, 2023
1 parent d5e0c48 commit a29bee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frameworks/svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SvelteFramework extends Framework {

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

refactorTemplates(keypath: string) {
Expand Down

0 comments on commit a29bee8

Please sign in to comment.