# json2pot

> Generate pot files from JSON keyed translation files.

Latest version **0.0.3** (published 2018-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install json2pot
pnpm add json2pot
yarn add json2pot
bun add json2pot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-05-08 |
| First published | 2018-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 4 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Diosney Sarmiento |
| Maintainers | diosney |
| Keywords | pot, json, translation |

## Links

- npm: https://www.npmjs.com/package/json2pot
- Repository: https://github.com/diosney/json2pot
- Issues: https://github.com/diosney/json2pot/issues
- npm.io page: https://npm.io/package/json2pot

## Dependencies (4)

- [globby](https://npm.io/package/globby.md) ^7.1.1
- [path-sort](https://npm.io/package/path-sort.md) ^0.1.0
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0
- [lodash.isplainobject](https://npm.io/package/lodash.isplainobject.md) ^4.0.6

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.3 (latest) — 2018-05-08
- 0.0.2 — 2018-05-08
- 0.0.1 — 2018-05-08

## README

# json2pot

## Information

| Package     | json2pot                                   |
| ----------- | ---------------------------------------- |
| Description | Generate pot files from JSON keyed translation files. |

## Install

```
$ npm install --save-dev json2pot
```


## Example usage

```js
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: undefined
  
- `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
  
- `lastTranslator`  
  Description: Name and email address of the last translator (ex: `John Doe <me@example.com>`)  
  Type: `string`  
  Default: undefined
  
- `package`  
  Description: Package name  
  Type: `string`  
  Default: `domain` or `unnamed project` if domain is undefined
  
- `src`  
  Description: Glob or globs to match files (see [Globbing Patterns](https://github.com/sindresorhus/globby#globbing-patterns))  
  Type: `string|array`  
  Default:  ['**/*.i18n.json', '**/i18n/*.json', '!node_modules']
  
- `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`


## Related
- [gulp-json2pot](https://github.com/diosney/gulp-json2pot) - Run json2pot via gulp  


## License

MIT © [Diosney Sarmiento](https://github.com/diosney)

Thanks to [Rasmus Bengtsson](https://github.com/rasmusbe) for its work on 
[wp-pot](https://github.com/rasmusbe/wp-pot) which this package is heavily based on.

---
_Source: https://npm.io/package/json2pot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
