i18n-ally icon indicating copy to clipboard operation
i18n-ally copied to clipboard

The plugin cannot identify the key with quotes.

Open a1245582339 opened this issue 2 years ago • 3 comments

Describe the bug

The plugin cannot identify the key with quotes. Extension Version

Name: i18n Ally Id: lokalise.i18n-ally Description: 🌍 All in one i18n extension for VS Code Version: 2.8.1 Framework/i18n package you are using

react-i18next To Reproduce Steps to reproduce the behavior:

  1. Add "i18n-ally.regex.key": ".*?" and "i18n-ally.disablePathParsing": true to settings.json.
  2. Input a key with single quote such as $t("I'm a coder.") in a tsx file.
  3. The key cannot be identified completely.

Device Infomation

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

Screenshots

image

a1245582339 avatar May 22 '22 07:05 a1245582339

And the & char too

wenfw avatar Feb 02 '23 02:02 wenfw

Want:

\$t\(\s*(['"`])(.*?)(?!\\)\1\s*(?!\\)\)

Actually Use:

(?<=\$t\(\s*['"`])(.*?)(?=(?!\\)['"`]\s*(?!\\)\))

settings.json

"i18n-ally.regex.key": "(?<=\\$t\\(\\s*['\"`])(.*?)(?=(?!\\\\)['\"`]\\s*(?!\\\\)\\))",

Please close this issue as solved.

NWater23 avatar Feb 24 '24 19:02 NWater23