Skip to content

gabegorelick/gulp-angular-gettext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Gulp plugin for extracting/compiling angular-gettext strings. http://angular-gettext.rocketeer.be/

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •