-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
40 lines (33 loc) · 1001 Bytes
/
Copy pathgulpfile.js
File metadata and controls
40 lines (33 loc) · 1001 Bytes
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
'use strict';
/*================================= Configuration =================================*/
const NODE_ENV = process.env.NODE_ENV || 'development';
let config = {
debug: NODE_ENV === 'development' ? true : false,
translation: {
domain: 'avista',
package: 'avista',
team: 'avista',
dest: './languages/avista.pot'
}
};
/*============================= Dependencies =============================*/
const gulp = require('gulp');
/* --- Dependencies: i18n --- */
const wpPot = require('gulp-wp-pot'),
sort = require('gulp-sort');
// Generates pot file for plugin localization.
let i18n = () => {
return gulp
.src([ './**/*.php', '!./build/**/*.php', '!./vendor/**/*.php' ])
.pipe(sort())
.pipe(
wpPot({
domain: config.translation.domain,
package: config.translation.package,
team: config.translation.team
})
)
.pipe(gulp.dest(config.translation.dest));
};
i18n.description = 'Generates pot file for plugin localization';
gulp.task('translate', i18n);