How to use node-wp-i18n - 1 common examples

To help you get started, we’ve selected a few node-wp-i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github studiopress / genesis-sample / .scripts / makepot.js View on Github external
#!/usr/bin/env node

// This script replaces the default use of `wpi18n makepot`, with custom
// POT file headers. It can be run with `npm run makepot`.

const chalk = require('chalk');
const wpi18n = require('node-wp-i18n');

console.log(chalk`{cyan Making pot file}...`);

wpi18n.makepot(
	{
		domainPath: 'languages',
		potHeaders: {
			'poedit': true,
			'x-poedit-basepath': '..',
			'report-msgid-bugs-to': 'StudioPress '
		}
	}
).then(
	(result) => console.log(chalk`{cyan Pot file updated at {bold ${result.domainPath}/${result.potFile}}}`),
	(err) => console.log(chalk`{red ${err}}`)
);

node-wp-i18n

Internationalize WordPress themes and plugins.

MIT
Latest version published 2 years ago

Package Health Score

42 / 100
Full package analysis

Popular node-wp-i18n functions