Skip to content

Bug: transloco-validator reports JSON comments #455

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
8 tasks
muuvmuuv opened this issue Jun 8, 2021 · 3 comments
Closed
8 tasks

Bug: transloco-validator reports JSON comments #455

muuvmuuv opened this issue Jun 8, 2021 · 3 comments

Comments

@muuvmuuv
Copy link

muuvmuuv commented Jun 8, 2021

Current behavior

Unexpected token / in JSON at position 1892

Expected behavior

Comments are valid in JSON. Sometimes it is recognized by an additional "c" after the json extension name ".jsonc" but not always.

Minimal reproduction of the problem with instructions

Provide the STEPS TO REPRODUCE and if possible a MINIMAL DEMO of the problem, for that you could use our stackblitz example

Screenshots

If applicable, add screenshots to help explain your problem.

Transloco config

Environment

- Transloco version: X.Y.Z
- Angular version: X.Y.Z

For Tooling issues:


- Node version: XX  
- Platform:  

Browser:

  • Chrome (desktop) version XX
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

Additional context

Add any other context about the problem here.

Contribution

I would like to make a pull request for this feature:
[x] Yes! 🚀 (If nobody else is faster)
[ ] Maybe next time

@muuvmuuv
Copy link
Author

muuvmuuv commented Jun 8, 2021

Oh, I missed a part where HTTPClientModule isn't compatible with comments as well... idk what to do now honestly. We have a lot of multiline comments which I do not want to insert into "feature.comment": "...".

Any ideas?

@muuvmuuv
Copy link
Author

muuvmuuv commented Jun 8, 2021

OK I found a way to fix the validator but sadly the optimizer cannot remove those:

  "features.comment.01": "------------------------------------------------", // not removed
  "features.comment.02": "------ Feature related translations below ------", // not removed
  "features.comment.03": "------------------------------------------------", // not removed
  "analysis_group": {
    "comment": "Filter component analysis group", // removed

Will edit the title will open a feature request for that

@shaharkazaz
Copy link
Collaborator

We'll close this issue in favour of #456

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants