forked from okfn/opendatasurvey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
29 lines (26 loc) · 907 Bytes
/
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
var gulp = require('gulp');
var gulpConcatPo = require('gulp-concat-po');
var gulpXgettext = require('gulp-xgettext');
var gulpReplace = require('gulp-replace');
var exec = require('child_process').exec;
gulp.task('pot', function(){
return gulp.src('templates/**/*.html', {
base: '.'
}).pipe(gulpReplace(/or gettext/g, "|| gettext")).pipe(gulpXgettext({
language: 'jinja',
keywords: [{
name: '_'
}].concat([{
name: 'format'
}]),
bin: 'node_modules/.bin/jsxgettext'
})).pipe(gulpConcatPo('messages.pot')).pipe(gulp.dest("locale/templates/LC_MESSAGES"));
});
gulp.task('update-po', function(){
return exec('./node_modules/.bin/merge-po locale');
});
// Task to prepare all /census/locale/*/LC_MESSAGES/*.po files to
// use with i18n-abide
gulp.task('compile-po', function() {
return exec('./node_modules/.bin/compile-json ./census/locale ./census/locale');
});