You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yesterday i18n stopped working all of a sudden for no apparent reason. After banging my head against a wall going through my code and trying to figure out when this had happened, I finally realized it is because when adding the last translation item in one language JSON file I had added a comma at the very end.
I know JSON specification does not allow trailing commas, but I did not get a complaint or error message from i18n. I think there should be some kind of indication when the JSON files provided are wrong (which I think i18n probably does already?), but this case I think should be considered?
Thank you!
The text was updated successfully, but these errors were encountered:
This library is being ported to a jquery indepedent javascript library. See https://github.com/wikimedia/banana-i18n/ It comes with a linter called banana-checker. There are some js framework loaders like vue loader(with vue binding). So I guess those projects take care of this. It is very unlikely that this project(jquery.i18n) will have any new features.
If you are using some good IDEs such as VS Code, there are extension that does this validation. If the translation json files are hand edited, there is a chance for syntax errors. but if a localization tool such as translatewiki.net is used, it is nearly impossible to get an invalid json.
It is quite simple.
A comma at the end of a translation JSON file like shown in my original post makes i18n fail without indication that there is an extra trailing comma.
Yesterday i18n stopped working all of a sudden for no apparent reason. After banging my head against a wall going through my code and trying to figure out when this had happened, I finally realized it is because when adding the last translation item in one language JSON file I had added a comma at the very end.
I know JSON specification does not allow trailing commas, but I did not get a complaint or error message from i18n. I think there should be some kind of indication when the JSON files provided are wrong (which I think i18n probably does already?), but this case I think should be considered?
Thank you!
The text was updated successfully, but these errors were encountered: