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

{fileName} and {fileNameWithoutExt} no longer work #476

Closed
k-yle opened this issue Feb 9, 2021 · 0 comments
Closed

{fileName} and {fileNameWithoutExt} no longer work #476

k-yle opened this issue Feb 9, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@k-yle
Copy link
Contributor

k-yle commented Feb 9, 2021

Describe the bug
Using {fileName} and {fileNameWithoutExt} in "i18n-ally.extract.keyPrefix", stopped working over the weekend. Maybe due to 17ac3de?

Extension Version
2.4.20

Framework/i18n package you are using
custom

To Reproduce
Steps to reproduce the behavior:

  1. Go to settings.json
  2. Add "i18n-ally.extract.keyPrefix": "{fileNameWithoutExt}."
  3. IN a file called MyDemo.js, select some text, press CTRL+Shift+P, select 🌏 Extract text into i18n messages
  4. Note how the suggested key contains the literal string "{fileNameWithoutExt}" instead of MyDemo

Device Infomation

  • OS: Windows 10
  • Version: 21292.1010
  • VS Code Version: 1.53.0

Extension Log

Click to open
🈶 Activated, v2.4.20

――――――

💼 Workspace root changed to "c:\Users\KyleH\GitHub\REDACTED\REDACTED"
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🍱 Custom framework setting loaded. 
{
  "languageIds": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
  ],
  "usageMatchRegex": [
    "[^\\w\\d]<\\$\\n? +id=['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(\\n? +['\"`]({key})['\"`]"
  ],
  "refactorTemplates": [
    "<$ id=\"$1\" />",
    "$$(\"$1\")",
    "{$$(\"$1\")}"
  ],
  "monopoly": true
}

🌞 Enabled
🧩 Enabled frameworks: Custom
🧬 Enabled parsers: json, yaml, json5

🚀 Initializing loader "c:\Users\KyleH\GitHub\REDACTED\REDACTED"
📂 Directory structure: file
🗃 Path Matcher Regex: /^(?<locale>[\w-_]+)\.(?<ext>json|ya?ml|json5)$/

📂 Loading locales under c:\Users\KyleH\GitHub\REDACTED\REDACTED\packages\client\src\translations\locales
	📑 Loading (de) de.json [1612820382095.0137]
	📑 Loading (en-US) en-US.json [1612665531037.0652]
	📑 Loading (en) en.json [1612820382096.0144]

👀 Watching change on c:\Users\KyleH\GitHub\REDACTED\REDACTED\packages\client\src\translations\locales
✅ Loading finished


――――――

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612822322494.6543]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612822322495.6548]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612824190988.8838]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612824190989.8801]
✅ Loading finished


🍱 Custom framework setting changed. Reloading...
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🍱 Custom framework setting loaded. 
{
  "languageIds": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
  ],
  "usageMatchRegex": [
    "[^\\w\\d]<\\$\\n? +id=['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(\\n? +['\"`]({key})['\"`]"
  ],
  "refactorTemplates": [
    "<$ id=\"$1\" />",
    "$$(\"$1\")",
    "{$$(\"$1\")}"
  ],
  "monopoly": true
}

🧩 Enabled frameworks: Custom
🧬 Enabled parsers: json, yaml, json5

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612828743605.9824]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612828745128.557]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612828745127.5571]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612828745128.557]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612828791701.468]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612828791702.4666]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612828825883.215]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612828827610.948]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612828827609.9475]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612828827610.948]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612828854721.3608]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612828854726.3606]
✅ Loading finished


🍱 Custom framework setting changed. Reloading...
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🍱 Custom framework setting loaded. 
{
  "languageIds": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
  ],
  "usageMatchRegex": [
    "[^\\w\\d]<\\$\\n? +id=['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(\\n? +['\"`]({key})['\"`]"
  ],
  "refactorTemplates": [
    "<$ id=\"$1\" />",
    "$$(\"$1\")",
    "{$$(\"$1\")}"
  ],
  "monopoly": true
}

🧩 Enabled frameworks: Custom
🧬 Enabled parsers: json, yaml, json5

💾 Writing c:\Users\KyleH\GitHub\REDACTED\REDACTED\packages\client\src\translations\locales\en.json
✅ Loading finished

🔄 File changed (change) en.json
	📑 Loading (en) en.json [1612829924765.1265]
✅ Loading finished

🔄 File changed (change) en.json
	📑 Loading (en) en.json [1612829942056.8943]
✅ Loading finished


🍱 Custom framework setting changed. Reloading...
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🍱 Custom framework setting loaded. 
{
  "languageIds": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
  ],
  "usageMatchRegex": [
    "[^\\w\\d]<\\$\\n? +id=['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(\\n? +['\"`]({key})['\"`]"
  ],
  "refactorTemplates": [
    "<$ id=\"$1\" />",
    "$$(\"$1\")",
    "{$$(\"$1\")}"
  ],
  "monopoly": true
}

🧩 Enabled frameworks: Custom
🧬 Enabled parsers: json, yaml, json5

🔄 File changed (change) en.json
	📑 Loading (en) en.json [1612833214182.8674]
✅ Loading finished

💾 Writing c:\Users\KyleH\GitHub\REDACTED\REDACTED\packages\client\src\translations\locales\en.json
✅ Loading finished

🔄 File changed (change) en.json
	📑 Loading (en) en.json [1612833569655.449]
✅ Loading finished

💾 Writing c:\Users\KyleH\GitHub\REDACTED\REDACTED\packages\client\src\translations\locales\en.json
✅ Loading finished

🔄 File changed (change) en.json
	📑 Loading (en) en.json [1612833580632.2107]
✅ Loading finished


🍱 Custom framework setting changed. Reloading...
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🍱 Custom framework setting loaded. 
{
  "languageIds": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
  ],
  "usageMatchRegex": [
    "[^\\w\\d]<\\$\\n? +id=['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(\\n? +['\"`]({key})['\"`]"
  ],
  "refactorTemplates": [
    "<$ id=\"$1\" />",
    "$$(\"$1\")",
    "{$$(\"$1\")}"
  ],
  "monopoly": true
}

🧩 Enabled frameworks: Custom
🧬 Enabled parsers: json, yaml, json5

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612836607728.3494]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612836607730.349]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612837085427.3992]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612837085435.4004]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612837237607.4429]
🔄 File changed (change) en.json
✅ Loading finished

	📑 Loading (en) en.json [1612837237608.4397]
✅ Loading finished

🔄 File changed (change) de.json
	📑 Loading (de) de.json [1612837270358.1797]
🔄 File changed (change) en.json
✅ Loading finished

🔄 File changed (change) de.json
🔄 File changed (change) en.json
🔄 File changed (change) de.json
🔄 File changed (change) en.json
	📑 Loading (en) en.json [1612837270704.5613]
	📑 Loading (de) de.json [1612837270703.5632]
✅ Loading finished


🍱 Custom framework setting changed. Reloading...
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🍱 Custom framework setting loaded. 
{
  "languageIds": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
  ],
  "usageMatchRegex": [
    "[^\\w\\d]<\\$\\n? +id=['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(['\"`]({key})['\"`]",
    "[^\\w\\d]\\$\\$\\(\\n? +['\"`]({key})['\"`]"
  ],
  "refactorTemplates": [
    "<$ id=\"$1\" />",
    "$$(\"$1\")",
    "{$$(\"$1\")}"
  ],
  "monopoly": true
}

🧩 Enabled frameworks: Custom
🧬 Enabled parsers: json, yaml, json5

Screenshots

@k-yle k-yle added the bug Something isn't working label Feb 9, 2021
@antfu antfu closed this as completed in 0cdd03c Feb 9, 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
Development

No branches or pull requests

1 participant