An npm package for converting gettext to icu.
Find a file
2016-03-23 00:31:37 -04:00
lib Make warning messages optional. 2016-03-23 00:31:37 -04:00
test Add icuToPython method 2016-03-22 23:53:39 -04:00
.eslintrc Initialize node module, wit dependencies 2015-10-09 16:45:14 -04:00
.gitignore Initial commit 2015-10-09 16:09:15 -04:00
index.js Use index for main instead of po2icu 2015-11-10 08:08:38 -05:00
LICENSE.txt Add MIT License 2015-10-13 14:38:19 -04:00
Makefile Initialize node module, wit dependencies 2015-10-09 16:45:14 -04:00
package.json Use index for main instead of po2icu 2015-11-10 08:08:38 -05:00
README.md Remove references 2015-10-13 14:37:59 -04:00

po2icu

A Node module for converting po-formatted files and strings into ICU-formatted JSON objects.

Usage

Convert a po-formatted string into an ICU-formatted JSON object.

poStringToICUSync(domain, poString)

var po2icu = require('po2icu');
var poContents = '<po-formatted string>';
var languageCode = 'es';
var icuContent = po2icu.poStringToICUSync(languageCode, poContents);

poStringToICUAsync(domain, poString, callback)

var po2icu = require('po2icu');
var poContents = '<po-formatted string>';
var languageCode = 'es';
var icuContent = po2icu.poStringToICUAsync(languageCode, poContents, function(err, data) {
  console.dir(data);
});

Convert a po-formatted file into an ICU-formatted JSON object.

poFileToICUSync(domain, poFilePath)

var po2icu = require('po2icu');
var poContents = '<path-to-pofile>';
var languageCode = 'es';
var icuContent = po2icu.poFileToICUSync(languageCode, poContents);

poFileToICUAsync(domain, poFilePath, callback)

var po2icu = require('po2icu');
var poContents = '<path-to-pofile>';
var languageCode = 'es';
var icuContent = po2icu.poFileToICUAsync(languageCode, poContents, function(err, data) {
  console.dir(data);
});