Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var translate = function () {
if (arguments.length === 0) {
grunt.warn(strings[options.locale]['translate.param.missing']);
}
var key = arguments[0];
if (!(key in strings[options.locale])) {
grunt.warn(strings[options.locale]['string.key.missing'] + ': ' + key);
}
var string = strings[options.locale][key];
for (var i = 1; i < arguments.length; i++) {
var replacementKey = '%' + i;
string = string.replace(replacementKey, arguments[i]);
}
return string;