i18next-conv
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -70,3 +70,3 @@ var Gettext = require("node-gettext") | ||
self.i18nextToGettextData(domain, source, path.extname(target), options, function(err, data) { | ||
self.i18nextToGettextData(domain, source, target, options, function(err, data) { | ||
self.writeFile(target, data, options, callback); | ||
@@ -73,0 +73,0 @@ }); |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"private": false, | ||
@@ -12,0 +12,0 @@ "preferGlobal": "true", |
@@ -213,2 +213,34 @@ var fs = require('fs') | ||
}); | ||
describe('toPO processing', function() { | ||
it('should convert a JSON file to utf8 PO', function(done) { | ||
var tests = []; | ||
// EN | ||
tests.push(function(next) { | ||
var output = './test/_tmp/en.utf8.po'; | ||
wrapper.i18nextToGettext('en', testFiles.en.utf8_expected, output, {quiet: true}, function(){ | ||
var result = fs.readFileSync(output); | ||
var expected = fs.readFileSync(testFiles.en.utf8); | ||
expect(result).to.deep.equal(expected); | ||
fs.unlinkSync(output); | ||
next(); | ||
}); | ||
}); | ||
// DE | ||
tests.push(function(next) { | ||
var output = './test/_tmp/de.utf8.po'; | ||
wrapper.i18nextToGettext('de', testFiles.de.utf8_expected, output, {quiet: true}, function(){ | ||
var result = fs.readFileSync(output); | ||
var expected = fs.readFileSync(testFiles.de.utf8); | ||
expect(result).to.deep.equal(expected); | ||
fs.unlinkSync(output); | ||
next(); | ||
}); | ||
}); | ||
async.series(tests, done); | ||
}); | ||
}) | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
107711
2637