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

Token detection broken in 2.11.* #1003

Closed
realvasko opened this issue Sep 1, 2023 · 9 comments · Fixed by #1013
Closed

Token detection broken in 2.11.* #1003

realvasko opened this issue Sep 1, 2023 · 9 comments · Fixed by #1013
Labels
bug Something isn't working

Comments

@realvasko
Copy link

Describe the bug
I've been using the plugin for quite some time now and this week I noticed it wouldn't correctly recognise the tokens in the source code (virtually rendering the plugin unusable). Downgrading to 2.10.0 solved the problem. I tried to see if there is maybe a config that has changed that needs adjustment, but couldn't find anything. Also tried changing the import from _ to t to no avail.

Extension Version
Both 2.11.0 and 2.11.1

Framework/i18n package you are using
svelte-i18n

Device Infomation

  • OS: macOS 13.5.1
  • Version: 2.11.1
  • VS Code Version: 1.81.1

Screenshots
image

@realvasko realvasko added the bug Something isn't working label Sep 1, 2023
@xdubx
Copy link

xdubx commented Sep 4, 2023

same issue here #1006

@extremegf
Copy link

I can confirm the issue exists:
image

Ubuntu 20.04
lokalise.i18n-ally] v2.11.1
vscode 1.80.2

@pointmax
Copy link

pointmax commented Sep 5, 2023

same issue here:
image

reverting to 2.10.0 for now. Seems like #1001 introduced a new bug while trying to fix it 🙃

@extremegf
Copy link

reverting to 2.10.0 for now. Seems like #1001 introduced a new bug while trying to fix it 🙃

Been there... :)

@MrVauxs
Copy link

MrVauxs commented Sep 10, 2023

Got the same error.
image

@ZerdoX-x
Copy link
Contributor

That's strange because current regex itself works fine...
(\\$(_|t|format)|(get)\\(\\s*(_|t|format)\\s*\\))\\(\\s*[\'"`]({key})[\'"`]
image

Bug was introduced by me in #826, #1001
Also strange that @5chulzi who opened #995 did not complained about this after issue was resolved in #1001

@ZerdoX-x
Copy link
Contributor

I found the issue. That's strange that doc is so far away from it's place

According to https://github.com/lokalise/i18n-ally/wiki/Custom-Framework

The key should be captured in the first match group

I just need to make rest of the groups non-capturing: all except ({key}) one. Fix coming soon, sorry for inconvenience once again, shame on me

@ZerdoX-x
Copy link
Contributor

Thanks to @multipliedtwice who left a comment in #1001. If someone would ping me earlier, it would have resolved faster.

@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

Successfully merging a pull request may close this issue.

7 participants