Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex error in latest version i18n Ally 2.11.0 #1000

Closed
Reikooters opened this issue Aug 30, 2023 · 4 comments
Closed

Regex error in latest version i18n Ally 2.11.0 #1000

Reikooters opened this issue Aug 30, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Reikooters
Copy link

Describe the bug
Extension not working in latest version due to regex error, which causes text to not be replaced with the strings from the locales json file as it normally should. - for example, $t("error.tryAgain") would normally change to $t(Try Again) but due to the error it's broken.

Extension Version
i18n Ally 2.11.0
Issue does not occur if you downgrade back to v2.10.0.

Framework/i18n package you are using
svelte-i18n

To Reproduce
Steps to reproduce the behavior:

  1. Open any .svelte file which uses svelte-i18n
  2. See error in console and popup toast notification in VS Code (error content and screenshot below)
  3. Issue does not occur if you downgrade back to v2.10.0.

Device Infomation

  • OS: Windows
  • Version: 10
  • VS Code Version: 1.81.1

Extension Log
Go to View -> Output -> i18n Ally, and paste the content below. You should mask any sensitive information

🈶 Activated, v2.11.0

――――――

💼 Workspace root changed to "c:\my-project"
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🌞 Enabled
🧩 Enabled frameworks: Svelte, General
🧬 Enabled parsers: json, yaml, json5

📈 Telemetry id: 83787482-1d65-4933-ad32-e7e48720ed1d
🚀 Initializing loader "c:\my-project"
📂 Directory structure: file
🗃 Path Matcher Regex: /^(?<locale>[\w-_]+)\.(?<ext>json|ya?ml|json5)$/

📂 Loading locales under c:\my-project\src\locales
	📑 Loading (en) en.json [1693354312990.5056]
	📑 Loading (es) es.json [1686636576551.6206]

👀 Watching change on c:\my-project\src\locales
✅ Loading finished


――――――

🐛 ERROR: SyntaxError: Invalid regular expression: /(\$(_|t|format)|(get)\(s*(_|t|format)s*\))(s*['"`]([\w\d\. \-\[\]\/:]*?)['"`]/: Unterminated group
SyntaxError: Invalid regular expression: /(\$(_|t|format)|(get)\(s*(_|t|format)s*\))(s*['"`]([\w\d\. \-\[\]\/:]*?)['"`]/: Unterminated group
	at new RegExp (<anonymous>)
	at c:\Users\shane\.vscode\extensions\lokalise.i18n-ally-2.11.0\dist\extension.js:320348:24
	at Array.map (<anonymous>)
	at normalizeUsageMatchRegex (c:\Users\shane\.vscode\extensions\lokalise.i18n-ally-2.11.0\dist\extension.js:320344:16)
	at Global.getUsageMatchRegex (c:\Users\shane\.vscode\extensions\lokalise.i18n-ally-2.11.0\dist\extension.js:311651:123)
	at KeyDetector.getKeys (c:\Users\shane\.vscode\extensions\lokalise.i18n-ally-2.11.0\dist\extension.js:312078:109)
	at KeyDetector.getUsages (c:\Users\shane\.vscode\extensions\lokalise.i18n-ally-2.11.0\dist\extension.js:312117:32)
	at ReviewCommentProvider.provideCommentingRanges (c:\Users\shane\.vscode\extensions\lokalise.i18n-ally-2.11.0\dist\extension.js:315226:74)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:102:98422
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:73:13539
	at new Promise (<anonymous>)
	at p (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:73:13510)
	at f.$provideCommentingRanges (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:102:98371)
	at t.N (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:114:7983)
	at t.M (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:114:7749)
	at t.H (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:114:6791)
	at t.G (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:114:5906)
	at r.value (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:114:4736)
	at f.w (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:63:1902)
	at f.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:63:2119)
	at y.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:79:13931)
	at r.value (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:30355)
	at f.w (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:63:1902)
	at f.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:63:2119)
	at y.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:79:13931)
	at MessagePortMain.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28635)
	at MessagePortMain.emit (node:events:513:28)
	at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)

Screenshots
image

@Reikooters Reikooters added the bug Something isn't working label Aug 30, 2023
@ZerdoX-x
Copy link
Contributor

@Reikooters dublicate of #995

fixed in #1001. please wait for merge and release

sorry for the inconvenience

@Reikooters
Copy link
Author

Thanks! And sorry for the duplicate.

@ZerdoX-x
Copy link
Contributor

That's ok. You can close this one as progress will be tracked in that issue

@terales
Copy link
Collaborator

terales commented Sep 23, 2023

Published fix in v2.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants