Socket
Socket
Sign inDemoInstall

i18next-conv

Package Overview
Dependencies
6
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

36

lib/gettextWrapper.js

@@ -67,10 +67,22 @@ var Gettext = require("node-gettext")

if (!fs.statSync(dir)) fs.mkdirSync(dir);
}
self.i18nextToGettextData(domain, source, path.extname(target), options, function(err, data) {
self.writeFile(target, data, options, callback);
});
},
i18nextToGettextData: function(domain, source, target, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
var self = this;
self.flattenI18nextJSON(source, options, function(err, flat) {
self.parseGettext(domain, flat, options, function(err, gt) {
var data = path.extname(target) === '.po' ? gt.compilePO(domain) : gt.compileMO(domain);
self.writeFile(target, data, options, callback);
callback(err, data);
});

@@ -191,9 +203,19 @@ });

self.gettextToI18nextData(domain, source, options, function(err, data) {
self.writeFile(target, data, options, callback);
});
},
gettextToI18nextData: function(domain, source, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
var self = this;
self.addTextDomain(domain, source, options, function(err, data) {
self.parseJSON(domain, data, options, function(err, json) {
var jsonData = JSON.stringify(json, null, 4);
self.writeFile(target, jsonData, options, callback);
callback(err, jsonData);
});

@@ -200,0 +222,0 @@ });

2

package.json

@@ -9,3 +9,3 @@ {

],
"version": "0.1.4",
"version": "0.1.5",
"private": false,

@@ -12,0 +12,0 @@ "preferGlobal": "true",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc