Skip to content

Instantly share code, notes, and snippets.

@nlf
Created December 1, 2015 00:14
Show Gist options
  • Save nlf/fd38bcb1318c3f70b00f to your computer and use it in GitHub Desktop.
Save nlf/fd38bcb1318c3f70b00f to your computer and use it in GitHub Desktop.
{ _id: 'grunt-po2json',
_rev: '1-94067eba43e20c23dd74b6e4a7b94628',
bugs: { url: 'https://github.com/rockykitamura/grunt-po2json/issues' },
name: 'grunt-po2json',
time:
{ '0.0.1': '2013-05-31T21:32:37.947Z',
'0.2.0': '2014-01-24T17:26:40.811Z',
'0.3.0': '2015-02-23T15:47:07.380Z',
created: '2013-05-31T21:32:36.816Z',
modified: '2015-02-23T15:47:07.380Z' },
author: { name: 'Rocky Kitamura', email: '[email protected]' },
readme: '# grunt-po2json\n\n> Convert PO files to JSON using Grunt.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.1`\n\nIf you haven\'t used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you\'re familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-po2json --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks(\'grunt-po2json\');\n```\n\n## The "po2json" task\n\n### Overview\nIn your project\'s Gruntfile, add a section named `po2json` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n po2json: {\n options: {\n format: \'raw\'\n }\n all: {\n src: [\'test/**/*.po\'],\n dest: \'some/destination/path/\'\n }\n },\n})\n```\n\n### Options\n\nAll of the options from [po2json](https://github.com/mikeedwards/po2json)\'s `parse` method are exposed through the options object.\n\n#### fuzzy\nType: `Boolean`\nDefault value: `false`\n\nWhether to include fuzzy translation in JSON or not. Should be either `true` or `false`\n\n#### stringify\nType: `Boolean`\nDefault value: `false`\n\nIf `true`, returns a JSON string. Otherwise returns a plain Javascript object.\n\n#### pretty\nType: `Boolean`\nDefault value: `false`\n\nIf `true`, the resulting JSON string will be pretty-printed. Has no effect when `stringify` is `false`.\n\n#### format\nType: `String`\nDefault value: `raw`\n\nEither `raw` or `jed`. `raw` produces a "raw" JSON output, while `jed` produces an output that is 100% compatible with [Jed](http://slexaxton.github.io/Jed/).\n\n#### domain\nType: `String`\nDefault value: `messages`\n\nThe domain the messages will be wrapped inside. Only has effect if `format: \'jed\'`.\n\n#### nodeJs\nType: `Boolean`\nDefault value: `false`\n\nWraps the JSON output in an export definition so it can be imported in Node.js.\n\n#### requireJs\nType: `Boolean`\nDefault value: `false`\n\nWraps the JSON output in an AMD definition so it can be imported by Require.js.\n\n\n#### stringOnly\nType: `Boolean`\nDefault value: `false`\n\nConverts all instances of `"id": [null, "str"]` to `"id": "str"`.\n\n#### singleFile\nType: `Boolean`\nDefault value: `false`\n\nInstead of creating one file for each .po file, writes all .po files to a single file. Property dest will be used as path to the destination file. The right extension will be appended, unless you specify it by yourself.\n\n## Usage\n\nThis grunt task runs po2json on every file in `src` and writes the output file to the `dest` path.\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n_(Nothing yet)_\n',
homepage: 'https://github.com/rockykitamura/grunt-po2json',
keywords: [ 'gruntplugin' ],
versions:
{ '0.3.0':
{ _id: '[email protected]',
bugs: [Object],
dist: [Object],
main: 'Gruntfile.js',
name: 'grunt-po2json',
_from: '.',
author: [Object],
_shasum: 'cb8859384ad4cc5a244c77cc026f38eac6b284c3',
engines: [Object],
gitHead: 'a79677639119ebf80f09cc936fbd30f0d8cb173b',
scripts: [Object],
version: '0.3.0',
_npmUser: [Object],
homepage: 'https://github.com/rockykitamura/grunt-po2json',
keywords: [Object],
licenses: [Object],
repository: [Object],
_npmVersion: '1.4.28',
description: 'Convert PO files to JSON using Grunt.',
maintainers: [Object],
dependencies: [Object],
devDependencies: [Object],
peerDependencies: [Object] } },
'dist-tags': { latest: '0.3.0' },
repository:
{ url: 'git://github.com/rockykitamura/grunt-po2json.git',
type: 'git' },
description: 'Convert PO files to JSON using Grunt.',
maintainers:
[ { name: 'rockykitamura',
email: '[email protected]' } ],
readmeFilename: 'README.md' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment