json2pot
v0.0.3
Published
Generate pot files from JSON keyed translation files.
Downloads
136
Readme
json2pot
Information
| Package | json2pot | | ----------- | ---------------------------------------- | | Description | Generate pot files from JSON keyed translation files. |
Install
$ npm install --save-dev json2pot
Example usage
const json2pot = require('json2pot');
json2pot({
destFile: 'file.pot',
domain : 'domain',
package : 'Example project',
src : 'src/*.php'
});
Options
All options are optional
bugReport
Description: Header with URL for reporting translation bugs
Type:string
Default: undefineddomain
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 PoeditlastTranslator
Description: Name and email address of the last translator (ex:John Doe <[email protected]>
)
Type:string
Default: undefinedpackage
Description: Package name
Type:string
Default:domain
orunnamed project
if domain is undefinedsrc
Description: Glob or globs to match files (see Globbing Patterns)
Type:string|array
Default: ['/*.i18n.json', '/i18n/*.json', '!node_modules']team
Description: Name and email address of the translation team (ex:Team <[email protected]>
)
Type:string
Default: undefinedwriteFile
Description: Write pot-file to disk. The function always returns the contents as well.
Type:boolean
Default:true
Related
- gulp-json2pot - Run json2pot via gulp
License
MIT © Diosney Sarmiento
Thanks to Rasmus Bengtsson for its work on wp-pot which this package is heavily based on.