-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
51 lines (46 loc) · 1.49 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const gulp = require('gulp');
const gettext = require('gulp-gettext');
const jshint = require('gulp-jshint');
const plumber = require('gulp-plumber');
const rename = require('gulp-rename');
const sort = require('gulp-sort');
const uglify = require('gulp-uglify');
const wppot = require('gulp-wp-pot');
gulp.task('default', function() {
console.log('Use the following commands');
console.log('--------------------------');
console.log('gulp wordpress-lang to compile the to-team.pot, to-team-en_EN.po and to-team-en_EN.mo');
});
gulp.task('wordpress-pot', function(done) {
return gulp.src('**/*.php')
.pipe(sort())
.pipe(wppot({
domain: 'to-team',
package: 'to-team',
bugReport: 'https://bitbucket.org/feedmycode/to-team',
team: 'LightSpeed <webmaster@lsdev.biz>'
}))
.pipe(gulp.dest('languages/to-team.pot')),
done();
});
gulp.task('wordpress-po', function(done) {
return gulp.src('**/*.php')
.pipe(sort())
.pipe(wppot({
domain: 'to-team',
package: 'to-team',
bugReport: 'https://bitbucket.org/feedmycode/to-team',
team: 'LightSpeed <webmaster@lsdev.biz>'
}))
.pipe(gulp.dest('languages/to-team-en_EN.po')),
done();
});
gulp.task('wordpress-po-mo', gulp.series( ['wordpress-po'], function(done) {
return gulp.src('languages/to-team-en_EN.po')
.pipe(gettext())
.pipe(gulp.dest('languages')),
done();
}));
gulp.task('wordpress-lang', gulp.series( ['wordpress-pot', 'wordpress-po-mo'] , function(done) {
done();
}));