added to packages.json
This commit is contained in:
parent
bc0bddd5cb
commit
badf79e134
2 changed files with 14 additions and 15 deletions
|
|
@ -6,19 +6,16 @@ var fs = require('fs');
|
|||
var path = require('path');
|
||||
var https = require('https');
|
||||
var AdmZip = require('adm-zip');
|
||||
var bhttp = require("bhttp");
|
||||
var bhttp = require('bhttp');
|
||||
|
||||
var crowdin_identifier = 'copay'
|
||||
|
||||
var crowdin_file_name1 = 'files[template.pot]'
|
||||
var local_file_name1 = path.join(__dirname, 'po/template.pot')
|
||||
var local_file1 = fs.createReadStream(local_file_name1)
|
||||
|
||||
var crowdin_file_name2 = 'files[appstore/appstore_en.txt]'
|
||||
var local_file_name2 = path.join(__dirname, 'docs/appstore_en.txt')
|
||||
var local_file2 = fs.createReadStream(local_file_name2)
|
||||
|
||||
var crowdin_file_name3 = 'files[appstore/updateinfo_en.txt]'
|
||||
var local_file_name3 = path.join(__dirname, 'docs/updateinfo_en.txt')
|
||||
var local_file3 = fs.createReadStream(local_file_name3)
|
||||
|
||||
|
|
@ -35,16 +32,16 @@ if (crowdin_api_key != '') {
|
|||
};
|
||||
|
||||
bhttp.post('https://api.crowdin.com/api/project/' + crowdin_identifier + '/update-file?key=' + crowdin_api_key, payload, {}, function(err, response) {
|
||||
console.log("Response from hosting service:", response.body.toString());
|
||||
console.log('Response from update file call:', response.body.toString());
|
||||
|
||||
// This call will tell the server to generate a new zip file for you based on most recent translations.
|
||||
https.get('https://api.crowdin.com/api/project/' + crowdin_identifier + '/export?key=' + crowdin_api_key, function(res) {
|
||||
console.log('Export Got response: ' + res.statusCode);
|
||||
}).on('error', function(e) {
|
||||
console.log('Export Got error: ' + e.message);
|
||||
});
|
||||
})
|
||||
|
||||
// This call will tell the server to generate a new zip file for you based on most recent translations.
|
||||
https.get('https://api.crowdin.com/api/project/' + crowdin_identifier + '/export?key=' + crowdin_api_key, function(res) {
|
||||
console.log("Export Got response: " + res.statusCode);
|
||||
}).on('error', function(e) {
|
||||
console.log("Export Got error: " + e.message);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -62,8 +59,9 @@ https.get('https://crowdin.com/download/project/' + crowdin_identifier + '.zip',
|
|||
pos += data[i].length;
|
||||
};
|
||||
var zip = new AdmZip(buf);
|
||||
zip.extractAllTo("./", true);
|
||||
console.log("Done extracting ZIP file.");
|
||||
zip.extractAllTo('./', true);
|
||||
console.log('Done extracting ZIP file.');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue