New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

locize-cli

Package Overview
Dependencies
Maintainers
2
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

locize-cli - npm Package Compare versions

Comparing version 3.4.3 to 3.5.0

3

CHANGELOG.md

@@ -0,1 +1,4 @@

## 3.5.0
- download resources as gettext po format
## 3.4.3

@@ -2,0 +5,0 @@ - add defaults for download (when calling programmatically)

@@ -12,2 +12,3 @@ const colors = require('colors');

const csvjson = require('csvjson');
const i18nextToPo = require('i18next-conv').i18nextToPo;

@@ -154,2 +155,34 @@ const download = (opt, cb) => {

(cb) => {
if (opt.format !== 'po' && opt.format !== 'gettext') return cb();
async.forEach(localFiles, (f, cb) => {
const newFilePath = f.pathToLocalFile.substring(0, f.pathToLocalFile.lastIndexOf('.')) + '.po';
fs.readFile(f.pathToLocalFile, 'utf8', (err, data) => {
if (err) return cb(err);
try {
const js = JSON.parse(data);
if (opt.skipEmpty && Object.keys(js).length === 0) {
return fs.unlink(f.pathToLocalFile, cb);
}
const splittedKey = f.pathToLocalFile.split('/');
const ns = splittedKey[splittedKey.length - 1];
const lng = splittedKey[splittedKey.length - 2];
const version = splittedKey[splittedKey.length - 3];
const projId = splittedKey[splittedKey.length - 4];
const options = { project: 'locize', language: lng };
i18nextToPo(lng, data, options)
.then((res) => {
fs.writeFile(newFilePath, res, 'utf8', (err) => {
if (err) return cb(err);
fs.unlink(f.pathToLocalFile, cb);
});
}, (err) => cb(err));
} catch (err) {
cb(err);
}
});
}, cb);
},
(cb) => {
if (opt.format !== 'csv') return cb();

@@ -156,0 +189,0 @@

7

package.json
{
"name": "locize-cli",
"version": "3.4.3",
"version": "3.5.0",
"description": "locize cli to import locales",

@@ -11,3 +11,3 @@ "main": "index.js",

"android-string-resource": "1.1.0",
"async": "2.5.0",
"async": "2.6.0",
"colors": "1.1.2",

@@ -17,2 +17,3 @@ "commander": "2.11.0",

"flat": "4.0.0",
"i18next-conv": "5.0.0",
"ini": "1.3.4",

@@ -24,3 +25,3 @@ "mkdirp": "0.5.1",

"devDependencies": {
"eslint": "4.9.0"
"eslint": "4.11.0"
},

@@ -27,0 +28,0 @@ "scripts": {

@@ -117,3 +117,3 @@ [![npm](https://img.shields.io/npm/v/locize-cli.svg)](https://npmjs.org/package/locize-cli)

or add a format like (flat, android, xliff2, xlliff12)
or add a format like (flat, android, xliff2, xlliff12, android, csv, po)

@@ -120,0 +120,0 @@ ```sh

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc