Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
[*] JS: Format gulpfile.js with jscs
Browse files Browse the repository at this point in the history
  • Loading branch information
gskema committed Jul 3, 2016
1 parent 720f7c0 commit c284f01
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@ gulp.task('create-zip', function() {
});
});

gulp.task('scan-translations', function (cb) {
glob(['themes/' + options.themeName + '/**/*.tpl', 'modules/**/*.tpl'], [], function (er, files) {
gulp.task('scan-translations', function(cb) {
glob(['themes/' + options.themeName + '/**/*.tpl', 'modules/**/*.tpl'], [], function(er, files) {

var brokenTranslations = [];
var totalFiles = files.length;
var scannedFiles = 0;

files.forEach(function (file) {
files.forEach(function(file) {
var translationContext = getTemplateContext(file);

fs.readFile(file, 'utf-8', function (err, contents) {
fs.readFile(file, 'utf-8', function(err, contents) {

var brokenTranslationsInFile = listBrokenTranslationStrings(contents, translationContext);
if (brokenTranslationsInFile.length) {
Expand All @@ -203,7 +203,7 @@ function getTemplateContext(templateFilePath) {

// modules/mymodule/views/templates/hook/block.tpl
if (typeof bits[0] == 'string' && bits[0] == 'modules') {
return bits[1]
return bits[1];
}

// 'themes/themename/modules/blockwishlist/my-account.tpl',
Expand All @@ -222,7 +222,7 @@ function listBrokenTranslationStrings(smartyTplCode, translationContext) {
return [];
}

return translations.filter(function (t) {
return translations.filter(function(t) {
if (translationContext.length) {
// Doesn't have correct context
return !((new RegExp('mod=[\'"]' + translationContext + '[\'"]')).test(t));
Expand Down

0 comments on commit c284f01

Please sign in to comment.