2015-11-09 11:40:36 -05:00
|
|
|
var fs = require('fs');
|
|
|
|
var path = require('path');
|
|
|
|
var po2icu = require('po2icu');
|
|
|
|
var tap = require('tap');
|
|
|
|
|
2015-11-09 15:22:49 -05:00
|
|
|
var buildLocales = require('../../lib/locale-compare');
|
2015-11-09 11:40:36 -05:00
|
|
|
|
|
|
|
tap.test('buildLocalesFile', function (t) {
|
2015-11-09 15:22:49 -05:00
|
|
|
var md5map = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../fixtures/test_es_md5map.json'), 'utf8'));
|
|
|
|
var newTranslations = po2icu.poFileToICUSync('es', path.resolve(__dirname, '../fixtures/test_es.po'));
|
2015-12-01 09:37:56 -05:00
|
|
|
var translations = buildLocales.mergeNewTranslations({}, newTranslations, {}, md5map);
|
2015-11-09 11:40:36 -05:00
|
|
|
|
|
|
|
t.ok(translations['test.id1'] !== undefined);
|
|
|
|
t.ok(translations['test.id2'] !== undefined);
|
|
|
|
t.end();
|
|
|
|
});
|