Skip to content

Commit

Permalink
Added gulp translate task
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalknecht committed Nov 16, 2016
1 parent 280e4c7 commit 839ca07
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');

var wpPot = require('gulp-wp-pot');
var sort = require('gulp-sort');

// See https://github.com/austinpray/asset-builder
var manifest = require('asset-builder')('./assets/manifest.json');

Expand Down Expand Up @@ -314,4 +317,18 @@ gulp.task('wiredep', function() {
// `gulp` - Run a complete build. To compile for production run `gulp --production`.
gulp.task('default', ['clean'], function() {
gulp.start('build');
});


gulp.task('translate', function () {
return gulp.src(['*.php', 'templates/*.php'])
.pipe(sort())
.pipe(wpPot( {
domain: 'sage',
destFile:'sage.pot',
package: 'sage',
bugReport: 'https://cubetech.com',
lastTranslator: 'cubetech <info@cubetech.ch>'
} ))
.pipe(gulp.dest('lang'));
});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
"gulp-rename": "^1.2.2",
"gulp-rev": "^6.0.0",
"gulp-sass": "^2.0.1",
"gulp-sort": "^2.0.0",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "^1.2.0",
"gulp-wp-pot": "^1.3.2",
"imagemin-pngcrush": "^4.1.0",
"jshint-stylish": "^2.0.1",
"lazypipe": "^1.0.1",
Expand Down

0 comments on commit 839ca07

Please sign in to comment.