/gulp-wp-pot

Gulp plugin to generate pot file for WordPress plugins and themes

Primary LanguageJavaScriptMIT LicenseMIT

gulp-wp-pot

Information

npm version Build Status Dependency Status Code Climate

Packagegulp-wp-pot
Description Generate pot files for WordPress plugins and themes.
Node Version >= 0.10

The package gulp-sort is recommended to prevent unnecessary changes in pot-file

Install

$ npm install --save-dev gulp-sort gulp-wp-pot

Example usage with Gulp

var gulp = require('gulp');
var wpPot = require('gulp-wp-pot');
var sort = require('gulp-sort');

gulp.task('default', function () {
    return gulp.src('src/*.php')
        .pipe(sort())
        .pipe(wpPot( {
            domain: 'domain',
            destFile:'file.pot',
            package: 'package_name',
            bugReport: 'http://example.com',
            lastTranslator: 'John Doe <mail@example.com>',
            team: 'Team Team <mail@example.com>'
        } ))
        .pipe(gulp.dest('dist'));
});

wpPot({options})

  • domain

    Type: string

    Domain to retrieve the translated text. All textdomains is included if missing.

  • destFile

    Type: string
    Default: domain.pot or translations.pot if domain is missing

    Filename for template file

  • package

    Type: string
    Default: domain or unnamed project if domain is missing

    Package name

  • bugReport

    Type: URL

    URL translatation support

  • lastTranslator

    Type: string

    Name and email address of the last translator (ex: John Doe <me@example.com>)

  • team

    Type: string

    Name and email address of the translation team (ex: Team <team@example.com>)

  • headers

    Type: object|bool
    Default: Headers used by Poedit

    Object containing extra POT-file headers. Set to false to not generate the default extra headers for Poedit.

License

MIT © Rasmus Bengtsson | Initial work by Willy Bahuaud