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