diff --git a/package.json b/package.json index b387c0f638..5f0b9ef6c8 100644 --- a/package.json +++ b/package.json @@ -109,6 +109,7 @@ "karma-requirejs": "~0.2.0", "karma-script-launcher": "~0.1.0", "lcov-result-merger": "^1.0.2", + "md5": "^2.0.0", "mocha": "~1.12.1", "mongoskin": "~0.6.1", "phantomjssmith": "~0.5.4", diff --git a/tasks/gulp-transifex-test.js b/tasks/gulp-transifex-test.js index f2dfd406bc..c50562bfc2 100644 --- a/tasks/gulp-transifex-test.js +++ b/tasks/gulp-transifex-test.js @@ -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//resource//translation//string// + // 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/);