tasks/swigtemplates.js
function doTranslations(files, locale, translator) {
      files.forEach(function(f) {
        f.src.filter(srcExists).map(function(filepath) {
          var pathInfo = getPathInfo(filepath, f.dest),
              context = getContext(f.context, pathInfo);
          if (locale !== options.defaultLocale) {
            pathInfo.outfile = path.join(f.dest, locale, pathInfo.outfilePath, pathInfo.outfileName);
          }
          context.locale = locale;
          options.locals[options.translateFunctionName] = function() {
            var args = Array.prototype.slice.call(arguments);
            return translator(args);
          };
          swig.setDefaults({ locals: options.locals });
          renderFile(pathInfo.outfile, filepath, context);
        });
      });
    }
function doTranslations(files, locale, translator) {
      files.forEach(function(f) {
        f.src.filter(srcExists).map(function(filepath) {
          var pathInfo = getPathInfo(filepath, f.dest),
              context = getContext(f.context, pathInfo);
          if (locale !== options.defaultLocale) {
            pathInfo.outfile = path.join(f.dest, locale, pathInfo.outfilePath, pathInfo.outfileName);
          }
          context.locale = locale;
          options.locals[options.translateFunctionName] = function() {
            var args = Array.prototype.slice.call(arguments);
            return translator(args);
          };
          swig.setDefaults({ locals: options.locals });
          renderFile(pathInfo.outfile, filepath, context);
        });
      });
    }
Do translations