Skip to content
Generate pot file for WordPress plugins and themes
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Revert to circleci Oct 1, 2019
.github/ISSUE_TEMPLATE
test Add option to ignore Template Name header Oct 6, 2019
.editorconfig Code style, fix for when headers is false Feb 17, 2017
.eslintignore
.eslintrc.json
.gitignore Change from istanbul to nyc for coverage Jun 24, 2019
CODE_OF_CONDUCT.md Updates for new org Aug 29, 2019
CONTRIBUTING.md
LICENSE Add new license Aug 29, 2019
index.js Add option to ignore Template Name header Oct 6, 2019
package-lock.json
package.json 1.8.0 Oct 7, 2019
pot-maker.js Fix syntax after new linting Jul 30, 2019
readme.md
translation-parser.js

readme.md

wp-pot

Information

Build Status npm version Scrutinizer Code Quality Code Coverage FOSSA Status Average time to resolve an issue Percentage of issues still open Greenkeeper badge

Package wp-pot
Description Generate pot files for WordPress plugins and themes.

Like my work and want to say thanks?

Do it here:
Buy Me A Coffee

Install

$ npm install --save-dev wp-pot

Example usage

const wpPot = require('wp-pot');

wpPot({
  destFile: 'file.pot',
  domain: 'domain',
  package: 'Example project',
  src: 'src/*.php'
});

Options

All options is optional

  • bugReport Description: Header with URL for reporting translation bugs. Type: string Default: undefined
  • commentKeyword Description: Keyword to trigger translator comment. Type: string Default: translators:
  • domain Description: Domain to retrieve the translated text. All textdomains is included if undefined. Type: string Default: undefined
  • destFile Description: Filename for template file. Type: string Default: domain.pot or translations.pot if domain is undefined.
  • headers Description: Object containing extra POT-file headers. Set to false to not generate the default extra headers for Poedit. Type: object|bool Default: Headers used by Poedit.
  • gettextFunctions Description: Gettext functions used for finding translations. Type: object Default: WordPress translation functions.
  • lastTranslator Description: Name and email address of the last translator (ex: John Doe <me@example.com>). Type: string Default: undefined
  • metadataFile Description: Path to file containing plugin/theme metadata header relative to relativeTo Type: string Default: undefined
  • noFilePaths Description: Do not print out file references in pot file. Type: bool Default: false
  • package Description: Package name. Type: string Default: domain or unnamed project if domain is undefined.
  • relativeTo Description: Path to folder that file comments should be relative to. Type: string Default: destFile location or current working directory if destFile is undefined.
  • src Description: Glob or globs to match files Type: string|array Default: **/*.php
  • globOpts Description: node-glob options object to be passed through. Type: Object Default: {}
  • team Description: Name and email address of the translation team (ex: Team <team@example.com> ). Type: string Default: undefined
  • writeFile Description: Write pot-file to disk. The function always returns the contents as well. Type: boolean Default: true
  • ignoreTemplateNameHeader Description: Do not extract /* Template Name: String */ headers to POT file. Type: boolean Default: false

Related

License

MIT © Rasmus Bengtsson

FOSSA Status

You can’t perform that action at this time.