Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.42 KB

README.md

File metadata and controls

48 lines (37 loc) · 1.42 KB

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])