wikimedia / jquery.i18n

🌐 jQuery based internationalization library
GNU General Public License v2.0
700 stars 143 forks source link

[Feature Request] Support for comments(//) in the localization files #199

Closed thepra closed 4 years ago

thepra commented 4 years ago

In the present version both single line comments and inline comments in any language.json file produce parsing errors after &.i18n().load(...)(if debug is set to true).

Comment's, both in single-line and inline would be really useful to keep track from which *.js module/s comes from that string/s.

santhoshtr commented 4 years ago

Comments are not allowed in json- such a json is not a valid json.

A practice that we follow in wikipedia is prefixing an identifier of the module, feature in the message key. For example: "modulename-feature-xxxxx-yyyyy-zzzzzz" This may help in grepping in the source code as well.

amire80 commented 4 years ago

Indeed. Comments just cannot be used in JSON.

Writing readable and relevant message keys is supposed to help with documentation, and most importantly, the documentation should be in the qqq file.