Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
($traceurRuntime.createClass)(i18n, {translate: function(key) {
for (var args = [],
$__2 = 1; $__2 < arguments.length; $__2++)
args[$__2 - 1] = arguments[$__2];
var keys = (typeof(key) == "string") ? key.split('.') : key;
var buffer = this.dict || {};
for (var i = 0; i < keys.length; i++) {
buffer = buffer[keys[i]];
if (!buffer)
break;
}
if (buffer) {
return typeof(buffer) == "string" ? printf.apply(null, $traceurRuntime.spread([buffer], args)) : buffer;
} else {
return (typeof(key) == "string" ? key : key.join("."));
}
}}, {});
module.exports = {
function printf() {
console.log(sprintf.apply(null, arguments));
}
log: function( msg ) {
msg = msg || '';
var printf = require('printf');
var finished = printf.apply( printf, arguments );
this.opts.silent || console.log( finished );
},
output: function(string) {
for (var args = [],
$__3 = 1; $__3 < arguments.length; $__3++)
args[$__3 - 1] = arguments[$__3];
this.stdout().write(printf.apply(null, $traceurRuntime.spread([string || ""], args)) + "\n");
},
tOutput: function() {
return function() {
var args = _.toArray(arguments);
if (proto.match(/^table/)) {
var msg = args;
} else {
var msg = (args[0].match(/%/)) ?
printf.apply(null, args) : azk.t.apply(null, args)
}
notify({ type: proto, msg: msg });
}
}