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

@@ -109,6 +109,7 @@
"karma-requirejs": "~0.2.0", "karma-requirejs": "~0.2.0",
"karma-script-launcher": "~0.1.0", "karma-script-launcher": "~0.1.0",
"lcov-result-merger": "^1.0.2", "lcov-result-merger": "^1.0.2",
"md5": "^2.0.0",
"mocha": "~1.12.1", "mocha": "~1.12.1",
"mongoskin": "~0.6.1", "mongoskin": "~0.6.1",
"phantomjssmith": "~0.5.4", "phantomjssmith": "~0.5.4",

View File

@@ -1,6 +1,7 @@
import fs from 'fs'; import fs from 'fs';
import _ from 'lodash'; import _ from 'lodash';
import nconf from 'nconf'; import nconf from 'nconf';
import md5 from 'md5';
import gulp from 'gulp'; import gulp from 'gulp';
import request from 'superagent'; import request from 'superagent';
@@ -14,6 +15,16 @@ const SLACK_CHANNEL = '#' + nconf.get('TRANSIFEX_SLACK:channel');
const SLACK_USERNAME = 'Transifex'; const SLACK_USERNAME = 'Transifex';
const SLACK_EMOJI = ':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', () => { gulp.task('transifex:untranslatedStrings', () => {
let missingStrings = []; let missingStrings = [];
@@ -105,6 +116,11 @@ function formatMessageForPosting(msg, items) {
return body; return body;
} }
function getHash(string) {
let hash = md5(`${string}:`);
return hash;
}
function stripOutNonJsonFiles(collection) { function stripOutNonJsonFiles(collection) {
let onlyJson = _.filter(collection, (file) => { let onlyJson = _.filter(collection, (file) => {
return file.match(/[a-zA-Z]*\.json/); return file.match(/[a-zA-Z]*\.json/);