Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('pot', () => {
gulp.src(config.php.src)
.pipe(sort())
.pipe(wpPot( {
domain: 'papi',
destFile:'papi.pot',
package: 'papi'
} ))
.pipe(gulp.dest('languages'));
});
gulp.task('translate', () => {
const opts = {
dest: './languages',
src: './**/*.php'
};
log(chalk.blue('--- Generating the translation file ---'));
return gulp.src(opts.src)
.pipe(
wpPot({
domain: 'wp-svg-helpers',
package:'WP SVG Helpers',
bugReport: 'https://github.com/allenmoore/wp-svg-helpers/issues',
lastTranslator: 'Allen Moore ',
team: 'Allen Moore '
})
)
.pipe(gulp.dest(`${opts.dest}/wp-svg-helpers.pot`))
.pipe(notify({message: '\n\n✅ ===> TRANSLATE — completed!\n', onLast: true}));
});
gulp.task('i18n:makepot', () => {
let options = {
destFile: `${pkg.name}.pot`,
package: pkg.name,
bugReport: pkg.author.url,
lastTranslator: `${pkg.author.name}<${pkg.author.email}>`,
team: `${pkg.author.name}<${pkg.author.email}>`
};
gulp.src('../**/*.php')
.pipe(sort())
.pipe(makepot(options))
.pipe(gulp.dest(paths.locales));
});
gulp.task('makepot', () =>
gulp.src(src_files.php)
.pipe(makepot({
domain: pkg.name,
package: 'Code Snippets',
bugReport: 'https://github.com/sheabunge/code-snippets/issues',
metadataFile: 'code-snippets.php',
}))
.pipe(gulp.dest(`languages/${pkg.name}.pot`)));