Package | wp-pot |
---|---|
Description | Generate pot files for WordPress plugins and themes. |
$ npm install --save-dev wp-pot
const wpPot = require('wp-pot');
wpPot({
destFile: 'file.pot',
domain: 'domain',
package: 'Example project',
src: 'src/*.php'
});
All options is optional
bugReport
Description: Header with URL for reporting translation bugs
Type:string
Default: undefinedcommentKeyword
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: undefineddestFile
Description: Filename for template file
Type:string
Default:domain.pot
ortranslations.pot
if domain is undefinedheaders
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 PoeditgettextFunctions
Description: Gettext functions used for finding translations.
Type:object
Default: WordPress translation functionslastTranslator
Description: Name and email address of the last translator (ex:John Doe <me@example.com>
)
Type:string
Default: undefinedpackage
Description: Package name
Type:string
Default:domain
orunnamed project
if domain is undefinedrelativeTo
Description: Path to folder that file comments should be relative to
Type:string
Default:destFile
location or current working directory ifdestFile
is undefinedsrc
Description: Glob or globs to match files (see Globbing Patterns)
Type:string|array
Default:**/*.php
team
Description: Name and email address of the translation team (ex:Team <team@example.com>
)
Type:string
Default: undefinedwriteFile
Description: Write pot-file to disk. The function always returns the contents as well.
Type:boolean
Default:true
- gulp-wp-pot - Run wp-pot via gulp
- wp-pot-cli - Run wp-pot via cli command
MIT © Rasmus Bengtsson