gulp-angular-gettext

2.3.0 • Public • Published

gulp-angular-gettext

Extract and compile translatable strings using angular-gettext

Install

Install with npm

npm install --save-dev gulp-angular-gettext

Example

var gulp = require('gulp');
var gettext = require('gulp-angular-gettext');
 
gulp.task('pot', function () {
    return gulp.src(['src/partials/**/*.html', 'src/scripts/**/*.js'])
        .pipe(gettext.extract('template.pot', {
            // options to pass to angular-gettext-tools...
        }))
        .pipe(gulp.dest('po/'));
});
 
gulp.task('translations', function () {
    return gulp.src('po/**/*.po')
        .pipe(gettext.compile({
            // options to pass to angular-gettext-tools...
            format: 'json'
        }))
        .pipe(gulp.dest('dist/translations/'));
});

API

.extract([out], [options])

  • out - an optional String representing the name of the POT file to output. If this option is given, a single POT file will be generated for the entire set of input files. If this option is omitted, one POT file will be generated per input file.
  • options - an optional object to pass to angular-gettext-tools Extractor

.compile([options])

Package Sidebar

Install

npm i gulp-angular-gettext

Weekly Downloads

3,052

Version

2.3.0

License

MIT

Unpacked Size

6.57 kB

Total Files

6

Last publish

Collaborators

  • gabegorelick