13
lib/po.js
13
lib/po.js
@@ -10,9 +10,6 @@ var PO = function () {
|
||||
this.items = [];
|
||||
};
|
||||
|
||||
PO.prototype.save = function (filename, callback) {
|
||||
require('fs').writeFile(filename, this.toString(), callback);
|
||||
};
|
||||
|
||||
PO.prototype.toString = function () {
|
||||
var lines = [];
|
||||
@@ -62,16 +59,6 @@ PO.prototype.toString = function () {
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
PO.load = function (filename, callback) {
|
||||
require('fs').readFile(filename, 'utf-8', function (err, data) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
var po = PO.parse(data);
|
||||
callback(null, po);
|
||||
});
|
||||
};
|
||||
|
||||
PO.parse = function (data) {
|
||||
//support both unix and windows newline formats.
|
||||
data = data.replace(/\r\n/g, '\n');
|
||||
|
||||
Reference in New Issue
Block a user