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

i18n-translate

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-translate - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

15

cli.js

@@ -11,3 +11,3 @@ #!/usr/bin/env node

if (args.length < 6) {
throw "not enough arguments: i18n-translate apiKey startDir sourceLang targetLang1,targetLang2,...";
throw "not enough arguments: i18n-translate apiKey startDir sourceLang targetLang1,targetLang2,.. (file1,file2,..)";
}

@@ -20,3 +20,14 @@

var targetLang = args[5].split(",");
var fileFilter = (args.length == 7) ? args[6].split(",") : null;
// trim whitespaces for targetlangs
for (var i = 0; i < targetLang.length; i++) {
targetLang[i] = targetLang[i].trim();
}
// trim whitespaces for filefilter
for (var i = 0; i < fileFilter.length; i++) {
fileFilter[i] = fileFilter[i].trim();
}
// append / at the end of directory

@@ -30,3 +41,3 @@ if (startDir[startDir.length - 1] != "/") {

// run translation
translate.run(apiKey, startDir, sourceLang, targetLang, function(err, result) {
translate.run(apiKey, startDir, sourceLang, targetLang, fileFilter, function(err, result) {

@@ -33,0 +44,0 @@ if (err) {

2

package.json

@@ -5,3 +5,3 @@ {

"preferGlobal": true,
"version": "1.0.7",
"version": "1.0.8",
"private": false,

@@ -8,0 +8,0 @@ "author": "Thomas Brüggemann",

@@ -1,2 +0,2 @@

# i18n-translate [![Build Status](https://travis-ci.org/tomaszbrue/i18n-translate.svg)](https://travis-ci.org/tomaszbrue/i18n-translate) [![npm](https://img.shields.io/badge/npm-1.0.6-blue.svg)](https://www.npmjs.com/package/i18n-translate)
# i18n-translate [![Build Status](https://travis-ci.org/tomaszbrue/i18n-translate.svg)](https://travis-ci.org/tomaszbrue/i18n-translate) [![npm](https://img.shields.io/badge/npm-1.0.8-blue.svg)](https://www.npmjs.com/package/i18n-translate)

@@ -16,3 +16,3 @@ Automatically translates [require.js i18n](http://requirejs.org/docs/api.html#i18n) javascript files into different languages via Google Translate API.

```
i18n-translate apiKey startDir sourceLang targetLang1,targetLang2
i18n-translate apiKey startDir sourceLang targetLang1,targetLang2,.. (file1,file2,..)
```

@@ -27,1 +27,3 @@

This would translate all the *.js files in test/data (relative to current folder in the shell) to translate from German to English and French, based on the Google Translate API language codes.
The *file filter* for specific file names is optional. You can specify files in the target folder that you exclusively want to be translated.

@@ -12,3 +12,3 @@ var fs = require("fs");

// RUN
var run = function(apiKey, dir, sourceLanguage, languages, finish) {
var run = function(apiKey, dir, sourceLanguage, languages, fileFilter, finish) {

@@ -205,2 +205,11 @@ var ggl = google(apiKey);

// a file filter is defined
if (fileFilter && fileFilter.length > 0) {
// filter out files by given file filter
files = files.filter(function(file) {
return fileFilter.indexOf(file) >= 0;
});
}
// process each file individually

@@ -207,0 +216,0 @@ async.map(files, processFile, finish);

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