mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Create shell of task for looking up strings
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
@@ -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/);
|
||||||
|
|||||||
Reference in New Issue
Block a user