Skip to content

don't write out strings from find_locale_strings during tests #2232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"test-image": "node tasks/test_image.js",
"test-image-gl2d": "node tasks/test_image.js gl2d_* --queue",
"test-export": "node tasks/test_export.js",
"test-syntax": "node tasks/test_syntax.js && npm run find-strings",
"test-syntax": "node tasks/test_syntax.js && npm run find-strings -- --no-output",
"test-bundle": "node tasks/test_bundle.js",
"test": "npm run test-jasmine && npm run test-bundle && npm run test-image && npm run test-image-gl2d && npm run test-syntax && npm run lint",
"start-test_dashboard": "node devtools/test_dashboard/server.js",
Expand Down
17 changes: 12 additions & 5 deletions tasks/find_locale_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var EXIT_CODE = 0;

var localizeRE = /(^|[\.])(_|localize)$/;

var noOutput = process.argv.indexOf('--no-output') !== -1;

// main
findLocaleStrings();

Expand Down Expand Up @@ -70,11 +72,16 @@ function findLocaleStrings() {
}

if(!EXIT_CODE) {
var strings = Object.keys(dict).sort().map(function(k) {
return k + spaces(maxLen - k.length) + ' // ' + dict[k];
}).join('\n');
common.writeFile(constants.pathToTranslationKeys, strings);
console.log('ok find_locale_strings');
if(noOutput) {
console.log('ok find_locale_strings - no output requested.');
}
else {
var strings = Object.keys(dict).sort().map(function(k) {
return k + spaces(maxLen - k.length) + ' // ' + dict[k];
}).join('\n');
common.writeFile(constants.pathToTranslationKeys, strings);
console.log('ok find_locale_strings - wrote new key file.');
}
}
});
}
Expand Down