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

Add json5 support #59

Closed
guyaumetremblay opened this issue Jul 17, 2019 · 8 comments
Closed

Add json5 support #59

guyaumetremblay opened this issue Jul 17, 2019 · 8 comments
Labels
0.x vue-i18n-ally

Comments

@guyaumetremblay
Copy link

Hi,

We use .json5 in our project to enable the use of comments in locales files.

Is it possible to add the support of this extension please?

Thanks in advance.

@antfu
Copy link
Contributor

antfu commented Jul 18, 2019

@guyaumetremblay Hi, I would love to do that.

But I am not sure is there a way to keep comments on json5.stringify. If it can't, should we disable the editing / translating features in this extension for json5?

@antfu
Copy link
Contributor

antfu commented Jul 18, 2019

@guyaumetremblay JSON5 supporting is landed from v0.27.0 🎉

As I mentioned above, stringify won't be able to keep the comments. You may want to set this extension to readonly mode by:

"vue-i18n-ally.readonly": true

For more details please refer to https://github.com/antfu/vue-i18n-ally#comments-in-yamljson5

@guyaumetremblay
Copy link
Author

guyaumetremblay commented Jul 18, 2019

Yes, that's sad. I just saw this issue on the JSON5 repo about keeping the comments: json5/json5#177

TLDR : the v3 of json5 will probably fix this.

About your update, I'm going to test this right now! Thanks for your fast update!

@guyaumetremblay
Copy link
Author

Hi again,

The new version is working as expected (in readonly as mentioned).

Thank you again! We'll follow the v3 of JSON5!

@antfu
Copy link
Contributor

antfu commented Jul 18, 2019

I would also check out how vscode handles its setting jsons (it supports comments and preserves comments) when I got free time. 😁

@guyaumetremblay
Copy link
Author

Yep that's right!
You can re-open this issue as a reminder if you want ;)

@antfu
Copy link
Contributor

antfu commented Jul 19, 2019

@guyaumetremblay Hi. I have found the parser vscode used to handle their settings.json and I opened another issue(#61) to support it.

Just as a reference, It's it possible for your project to adapt to JSONC or is there some other features in JSON5 are necessary to you? Thanks

@guyaumetremblay
Copy link
Author

@antfu Sorry but I can take this decision, neither propose to move from json5 to jsonc only for a VSCode plugin. Their is 30 developers working on this project at my client side and their is only a few who use vscode :(

@antfu antfu added the 0.x vue-i18n-ally label Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.x vue-i18n-ally
Development

No branches or pull requests

2 participants