Gulp plugin for extracting/compiling angular-gettext strings. http://angular-gettext.rocketeer.be/
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Use file.relative for extractor filename Jan 11, 2015
test Switch to ESLint May 21, 2016
.eslintrc
.gitattributes
.gitignore
.travis.yml Update travis config May 21, 2016
LICENSE
README.md
index.js
package.json

README.md

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