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

Wrong paths written to i18n-ally.localesPaths using Windows folder browse dialog #477

Closed
aangelcc opened this issue Feb 9, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@aangelcc
Copy link

aangelcc commented Feb 9, 2021

Describe the bug
When using the editor command "i18n Ally: Manually configure locales path" wrong paths are written to i18n-ally.localesPaths in .vscode/settings.json. I.e. src\\locale is written instead of src/locale, making the extension fail at detecting locales.

Actually I think that the bug is rather that the extension doesn't support windows paths coming from settings.json file. As soon as I replace \\ for / in the path written by the "i18n Ally: Manually configure locales path" command , everything works again.

Extension Version
lokalise.i18n-ally v2.4.20

Framework/i18n package you are using
Angular 11 + ngx-translate 13.0.0

To Reproduce
Steps to reproduce the behavior:

  1. For instance suppose my project locales are under src/locale, so that my .vscode/settings.json file looks like this (default locale location):
i18n-ally.localesPaths": [
    "src/locale"
  ]
  1. Now let's say I want to add another locales folder, src/i18n ,so I do (under Windows) Ctrl+Shift+P and run "i18n Ally: Manually configure locales path". After that, .vscode/settings.json looks like this:
"i18n-ally.localesPaths": [
    "src/locale",
    "src\\marxact-i18n\\uniconnect-view"
  ]
  1. Extension doesn't load locales from the new added folder.
  2. To fix it I need to replace in the written path \\ for / and everything works as expected.

Device Infomation

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

Extension Log

🧰 Config "i18n-ally.localesPaths" changed, reloading
🔁 Reloading loader
📦 Packages file "package.json" found
🕳 Packages file "pubspec.yaml" not exists
🕳 Packages file "composer.json" not exists
🕳 Packages file "Gemfile" not exists
🧩 Enabled frameworks: Angular ngx-translate
🧬 Enabled parsers: json, yaml, json5


⚠ No locales paths.
✅ Loading finished
@aangelcc aangelcc added the bug Something isn't working label Feb 9, 2021
@antfu antfu closed this as completed in 7ab8269 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