1.10.2 • Published 2 years ago
wp-pot v1.10.2
wp-pot
Information
Package | wp-pot |
---|---|
Description | Generate pot files for WordPress plugins and themes. |
Like my work and want to say thanks?
Install
npm install --save-dev wp-pot
Example usage
PHP File Parsing
const wpPot = require('wp-pot');
wpPot({
destFile: 'file.pot',
domain: 'domain',
package: 'Example project',
src: 'src/*.php'
});
JS File Parsing (only js, no jsx for now)
wpPot({
parser: 'js',
parserOptions: {
ecmaVersion: 6,
},
src: 'test/fixtures/edge-cases.js'
});
Options
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:
copyrightText
Description: Copyright text Type:function|string
Default: A function that takesoptions
object as a argument and return the default copyright text.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 undefined.headers
Description: Object containing all default 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.includePOTCreationDate
Description: Auto-populate thePOT-Creation-Date
header. Type:bool
Default: truelastTranslator
Description: Name and email address of the last translator (ex:John Doe <me@example.com>
). Type:string
Default: undefinedmetadataFile
Description: Path to file containing plugin/theme metadata header relative torelativeTo
Type:string
Default: undefinednoFilePaths
Description: Do not print out file references in pot file. Type:bool
Default: falsepackage
Description: Package name. Type:string
Default:domain
orunnamed project
if domain is undefined.parser
Description: PHP or JS parser Type:string
Default:php
parserOptions
Description: Options for the JS parser Espree. See here. Type:object
Default:{ comment: true, loc: true }
relativeTo
Description: Path to folder that file comments should be relative to. Type:string
Default:destFile
location or current working directory ifdestFile
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: undefinedwriteFile
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
- php-parser - NodeJS PHP Parser used in this project
- gulp-wp-pot - Run wp-pot via gulp
- wp-pot-cli - Run wp-pot via cli command
License
MIT © Rasmus Bengtsson
1.10.2
2 years ago
1.10.1
2 years ago
1.10.0
2 years ago
2.0.0-0
3 years ago
2.0.0
3 years ago
1.9.9
3 years ago
1.9.8
3 years ago
1.9.7
3 years ago
1.9.6
4 years ago
1.9.4
4 years ago
1.9.3
4 years ago
1.9.2
4 years ago
1.9.1
4 years ago
1.9.0
4 years ago
1.8.0
5 years ago
1.7.3
5 years ago
1.7.2
5 years ago
1.7.1
5 years ago
1.7.0
5 years ago
1.6.6
5 years ago
1.6.5
5 years ago
1.6.4
6 years ago
1.6.3
6 years ago
1.6.2
6 years ago
1.6.1
6 years ago
1.6.0
6 years ago
1.6.0-2
6 years ago
1.6.0-1
6 years ago
1.6.0-0
6 years ago
1.5.1
6 years ago
1.5.0
6 years ago
1.4.0
6 years ago
1.3.5
7 years ago
1.3.4
7 years ago
1.3.3
7 years ago
1.3.2
7 years ago
1.3.1
7 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.5
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.0
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago