Skip to content

Extracting text from template strings with interpolation does not work properly in pure JS files #613

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

Closed
FelixGraf opened this issue Jun 30, 2021 · 0 comments
Assignees
Labels
bug Something isn't working sp:8

Comments

@FelixGraf
Copy link

FelixGraf commented Jun 30, 2021

Describe the bug

When having the following code snippet in a pure JS file and trying to extract the ´Hello ${test}´ part, it does not transform the test variable into a parameter {0} but instead the output in the JSON file is just "Hello ${test}". When doing the same within the <script> of a Vue SFC, it works without problems. (Also see the attached screen recording)

const test = 123;
const hello = `Hello ${test}`;

Extension Version
v2.6.10

Framework/i18n package you are using
vue-i18n

To Reproduce
Steps to reproduce the behavior:

  1. Copy the code snippet from above to a JS file
  2. Select the template string and extract it

Device Infomation

  • OS: macOS
  • Version: Big Sur 11.2
  • VS Code Version: 1.57

Extension Log

💾 Writing /Users/felixgraf/XXXXX/src/locales/de-DE.json
✅ Loading finished

🔄 File changed (change) de-DE.json
	📑 Loading (de-DE) de-DE.json [1625065608360.614]
🔄 File changed (change) de-DE.json
	📑 Loading (de-DE) de-DE.json [1625065608360.614]
✅ Loading finished

✅ Loading finished

Screenshots

Bildschirmaufnahme.2021-06-30.um.17.04.10.mov
@FelixGraf FelixGraf added the bug Something isn't working label Jun 30, 2021
@terales terales added the sp:8 label Jul 7, 2021
@terales terales added this to the Weekly cycle 020 milestone Jul 14, 2021
@antfu antfu closed this as completed in a2b1cd8 Jul 14, 2021
antfu added a commit that referenced this issue Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sp:8
Development

No branches or pull requests

3 participants