to actually use filesize, you probably want to do something like
var size, e;
if (bytes) {
  e = Math.floor(Math.log(bytes) / Math.log(1024));
  size = (bytes / Math.pow(1024, e)).toFixed(2);
}
else {
  e = 0;
  size = '0.00';
}
return _('filesize', {unit:_('byteUnit-'+units[e]),size:size});

or so. The syntax of the api call in the last line is mostly guessed, sorry. But the logic of the rest of the code should work somewhat like this.