Create shell of task for looking up strings

This commit is contained in:
Blade Barringer
2015-08-07 09:34:18 -05:00
parent 563072712b
commit 894611bc34
2 changed files with 17 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import fs from 'fs';
import _ from 'lodash';
import nconf from 'nconf';
import md5 from 'md5';
import gulp from 'gulp';
import request from 'superagent';
@@ -14,6 +15,16 @@ const SLACK_CHANNEL = '#' + nconf.get('TRANSIFEX_SLACK:channel');
const SLACK_USERNAME = 'Transifex';
const SLACK_EMOJI = ':transifex:';
gulp.task('transifex:look', () => {
// curl -i -L --user username:password -X GET https://www.transifex.com/api/2/project/transifex/resource/core/translation/pt_BR/string/e9fbd679f07d178744bfa80344080962/
// /project/<project_slug>/resource/<resource_slug>/translation/<language_code>/string/<source_hash>/
// request.get('https://www.transifex.com/api/2/project/habitrpg/resource/petsjson/translation/uk/string/7541ebdf41af9839f458f9afb1644882/')
// .end((err, res) => {
// if (err) console.log(":(", err);
// else console.log(res.body);
// });
});
gulp.task('transifex:untranslatedStrings', () => {
let missingStrings = [];
@@ -105,6 +116,11 @@ function formatMessageForPosting(msg, items) {
return body;
}
function getHash(string) {
let hash = md5(`${string}:`);
return hash;
}
function stripOutNonJsonFiles(collection) {
let onlyJson = _.filter(collection, (file) => {
return file.match(/[a-zA-Z]*\.json/);