gulp-po

1.0.8 • Public • Published

Gulp-PO

Gulp extension for synchronizing translates from POEditor.

Installation

npm install gulp-po

Usage

Allowed actions:

  • push: Pushes all terms and translates to the POEditor server
  • pull: Pulls all translates from the POEditor server and replace changed ones in files
  • sync: Pushes all terms to the POEditor server

You can provide translate files in following formats: JSON, YAML, NEON

var poConnector = require('gulp-po');
 
createTranslatesPlumber: function() {
    return plumber(function(error) {
        gutil.log(gutil.colors.red(error));
        gutil.beep();
        this.emit('end');
    });
}
 
gulp.task('translates-push', function() {
    return gulp.src('./translates/**/*.json')
        .pipe(pipes.createTranslatesPlumber())
        .pipe(poConnector('push', options))
        .pipe(gulp.dest('./translates/'))
});

Options

Required parameters:

  • apiToken: Token generated on POEditor website
  • project: Name of the project

Optional parameters:

  • langs: Object of language mapping. You can map key to val, where key is original POEditor code, e.g. zh-TW to zh

Example:

var options = {
    apiToken: '19xf1dfbfy36b96f0ba9f7zd94a83d9e',
    project: 'ExampleProject',
    langs: {
        'zh-TW': 'zh'
    }
};

/gulp-po/

    Package Sidebar

    Install

    npm i gulp-po

    Weekly Downloads

    6

    Version

    1.0.8

    License

    MIT

    Last publish

    Collaborators

    • smartlook.npm
    • c0mtru1se
    • samialdury
    • jakubpetriska
    • pjk
    • amertak
    • acro
    • janzal
    • millcek
    • joozty
    • klobinoid
    • potty