opral / inlang-sherlock

Issue tracker for Sherlock
https://marketplace.visualstudio.com/items?itemName=inlang.vs-code-extension
2 stars 0 forks source link

Do not allow to extract a message with a number as the ID #46

Closed action-simon closed 1 month ago

action-simon commented 1 month ago

Hello,

If you extract a string for example "3 dogs" and try to use 3_dogs as the ID, it will throw an error. I would automatically replace the number at the first place with something else. You could replace with three.

felixhaeberle commented 1 month ago

@action-simon can you provide a example setup where this occurs? Which modules are you using?

action-simon commented 1 month ago

Hi, I can not share the code itself, but I try to explain how to reproduce. I am using @inlang/paraglide-next 0.3.0 and @inlang/paraglide-js 1.9.1 and Sherlock 1.44.3 inside vscode. The project is using next js 14 with ts.

Now to the repro steps:

  1. I have a string lets say "500 Balloons"

  2. Usually I copy the complete string to use it as an ID.

  3. Now after pressing . ctrl the menu opens, where I can extract the selected message

  4. I am asked what the ID should be. I paste 500 Balloons image

  5. Sherlock accepts the ID, but now I am getting errors because of the number in front of the ID. image

I would recommend to automatically replace a number with something else or perhaps add an _ (underscore) in front of the ID if it's a number so that there is no error in case people try to put a number in front of an ID.