`i18n-lint` is a tool for detecting possible hardcoded strings in HTML and HTML-based template source files. It can be used a CLI utility, a library or a Grunt plugin.
Creating the custom reporter as provided in the example here: http://jwarby.github.io/i18n-lint/#usage (under Reporters) results into the error below (node v8.9.4):
$ i18n-lint -r i18_reporter.js -t '{{,}}' app/views/product/*.html
net.js:701
throw new TypeError(
^
TypeError: Invalid data, chunk must be a string or buffer, not object
at WriteStream.Socket.write (net.js:701:11)
at /usr/local/lib/node_modules/i18n-lint/bin/i18n-lint:191:26
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/i18n-lint/bin/i18n-lint:170:11
at f (/usr/local/lib/node_modules/i18n-lint/node_modules/once/once.js:25:25)
at Glob.<anonymous> (/usr/local/lib/node_modules/i18n-lint/node_modules/glob/glob.js:133:7)
at emitOne (events.js:116:13)
at Glob.emit (events.js:211:7)
at Glob._finish (/usr/local/lib/node_modules/i18n-lint/node_modules/glob/glob.js:172:8)
at done (/usr/local/lib/node_modules/i18n-lint/node_modules/glob/glob.js:159:12)
In my case the solution was changing the code to:
module.exports = function(errors) {
var len = errors.length,
filename;
if (len) {
filename = errors[0].file;
process.stdout.write(filename + '\n -- ' + len + ' hardcoded string(s)\n');
}
};
I can create a pull-request with the fix to docs if needed.
Creating the custom reporter as provided in the example here: http://jwarby.github.io/i18n-lint/#usage (under Reporters) results into the error below (node v8.9.4):
In my case the solution was changing the code to:
I can create a pull-request with the fix to docs if needed.