@dcousineau/gulp-po-concat
v0.0.4
Published
Gulp plugin to concatenate PO files
Downloads
18
Maintainers
Readme
gulp-po-concat
Concatenate PO files
Install
Install with npm
npm install --save-dev gulp-po-concat
Example
var gulp = require('gulp');
var poConcat = require('gulp-po-concat');
var xgettextHbs = require('gulp-xgettext-handlebars');
var xgettextJs = require('gulp-xgettext-js-more-better');
var merge = require('event-stream').merge;
gulp.task('pot', function () {
return merge(
gulp.src(['**/*.hbs'])
.pipe(xgettextHbs()),
gulp.src(['**/*.js'])
.pipe(xgettextJs()))
.pipe(poConcat())
.pipe(gulp.dest('po/'));
});
Options
domain
PoConcat's default behavior is to assign messages to a domain that matches the
file's name. You can optionally request poConcat to force all messages to use a
specified domain by setting the domain
attribute in the options object.
gulp.src('**/*.js')
.pipe(xgettextJs())
.pipe(poConcat({ domain: "messages" }))
.pipe(gulp.dest('po/'));
The above example concat all found strings into a single domain/file of "messages"
You may also pass a function which receives a file object to name the domain:
var path = require('path');
gulp.src('**/*.js')
.pipe(xgettextJs())
.pipe(poConcat({
domain: function(file) {
return path.basename(file.path, '.pot');
}
}))
.pipe(gulp.dest('po/'));
The above is the current default behavior.