gulp-po2angular

Gulp plugin to convert .po files to JSON for use with angular-gettext

This module is deprecated. Please use gulp-angular-gettext instead.

gulp-po2angular

Convert .po files to JSON for use with angular-gettext.

Install with npm

npm install --save-dev gulp-po2angular
var gulp = require('gulp');
var po2angular = require('gulp-po2angular');
 
gulp.task('po2json', function () {
    return gulp.src(['po/**/*.po'])
        .pipe(po2angular())
        .pipe(gulp.dest('dist/translations/'));
});

Differences from grunt-angular-gettext

This plugin is similar to grunt-angular-gettext except that it outputs JSON instead of JSON wrapped in JavaScript. It's up to you how you load the resulting JSON into your app.

Differences from gulp-po2json

gulp-po2json generates slightly different JSON than what angular-gettext expects. It's pretty easy to convert its output (either raw or Jed-style) to the format that angular-gettext expects, but why bother when this plugin exists?