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

i18n Ally fails cryptically and unhelpfully when extra stuff is in your locale folder

Open dantman opened this issue 2 years ago • 2 comments

Describe the bug If your locales folder contain an non-locale directory i18n Ally will fail to load without proper warning or telling you what is wrong.

There is no error message popup saying i18n Ally failed to start. i18n Ally's sidebar is just empty and no messages show up in code. If you investigate the (Remote) Extension Host log you will find this error which tells you nothing about what is wrong.

[2021-12-08 11:51:40.697] [exthost] [error] Activating extension lokalise.i18n-ally failed due to an error:
[2021-12-08 11:51:40.697] [exthost] [error] RangeError: Incorrect locale information provided
	at Object.getCanonicalLocales (<anonymous>)
	at BCP47.lookup (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:316106:32)
	at .../e-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:310873:75
	at Array.map (<anonymous>)
	at LocaleLoader.guessDirStructure (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:310873:14)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async LocaleLoader.init (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:310815:35)
	at async Function.initLoader (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:309015:9)
	at async Function.update (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:309099:13)
	at async Function.updateRootPath (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:309040:13)
	at async Function.init (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:308819:9)
	at async activate (.../.vscode-server/extensions/lokalise.i18n-ally-2.8.1/dist/extension.js:312584:5)

Extension Version i18n Ally

Framework/i18n package you are using react-i18next

To Reproduce Steps to reproduce the behavior:

  1. Start with a valid project that i18n Ally recognizes messages in code for
  2. Create an empty test directory in your locales folder (e.g. if public/locales/en/common.json is your main messages, create an empty public/locales/test/ folder

Device Infomation

  • OS: Windows (WSL)
  • VS Code Version: 1.62.3

Extension Log Go to View -> Output -> i18n Ally, and paste the content below. You should mask any sensitive information

🈶 Activated, v2.8.1

――――――

💼 Workspace root changed to "..."
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🌞 Enabled
🧩 Enabled frameworks: React, General
🧬 Enabled parsers: json, yaml, json5

📈 Telemetry id: ...
🚀 Initializing loader "..."

dantman avatar Dec 08 '21 19:12 dantman

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 06 '22 21:02 stale[bot]

Should not be marked stale, the only thing missing here is a maintainer.

dantman avatar Feb 06 '22 21:02 dantman