app/node/po2json.js

Summary

Maintainability
A
0 mins
Test Coverage
// Generated by CoffeeScript 1.3.3
(function() {
  var basePath, fs, outputPath, po2json, sourcePath;

  sourcePath = process.argv[2];

  outputPath = process.argv[3];

  basePath = process.argv[4];

  po2json = require("../../vendor/node/po2json.js");

  fs = require('fs');

  po2json.parse(sourcePath, function(result) {
    var base;
    base = fs.readFileSync(fs.realpathSync(basePath), 'utf8');
    if (base == null) {
      base = "";
    }
    result = "if (window.i18n == undefined) window.i18n = {};\n" + base + "\nwindow.i18n.locale_data = " + result;
    console.log("write file");
    return fs.writeFile(outputPath, result, function(err) {
      if (err) {
        return console.log(err);
      } else {
        return console.log("po file converted and saved to " + outputPath);
      }
    });
  });

}).call(this);