{"_id":"@dreamproduction/grunt-gettext-twig-parser","_rev":"9-d883758c22309a68166b334bb60f2175","name":"@dreamproduction/grunt-gettext-twig-parser","description":"A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@dreamproduction/grunt-gettext-twig-parser","description":"A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.","version":"0.1.0","homepage":"https://dreamproduction.com","author":{"name":"Dream Production","email":"contact@dreamproduction.com"},"repository":{"type":"git","url":"git://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser"},"bugs":{"url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/issues"},"licenses":[{"type":"MIT","url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/tree/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"^0.9.2","grunt-contrib-clean":"^0.5.0","grunt-contrib-nodeunit":"^0.3.3","grunt":"~0.4.5"},"keywords":["gruntplugin"],"main":"Gruntfile.js","directories":{"test":"test"},"dependencies":{},"license":"ISC","gitHead":"ccaed7c3be3b62d7ea3ffdb3a6caa8dc94caf165","_id":"@dreamproduction/grunt-gettext-twig-parser@0.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"florin.sarba","email":"florin@dreamproduction.com"},"dist":{"integrity":"sha512-7vl4YqrbTGF7mcXHn/vUP8ROUi46r0vdqlJNJPtnjSEXMgpmjrxD42ippxGAz/h+3E++iDaoTDtoL5xQ8rUcdg==","shasum":"e1b23d5aaa4465ea1212f84defd23dbf57db0294","tarball":"https://registry.npmjs.org/@dreamproduction/grunt-gettext-twig-parser/-/grunt-gettext-twig-parser-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCumRXtWdQ6xG5FRDPiKhq2pogt4ZOe7/iFwdjxIiAswAIhAJFxlWoyb0bK0BMpV7q6LFd21xGhnXOqoT9RTN2q06+F"}]},"maintainers":[{"name":"florin.sarba","email":"florin@dreamproduction.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-gettext-twig-parser-0.1.0.tgz_1506589043349_0.5282177850604057"}},"0.1.1":{"name":"@dreamproduction/grunt-gettext-twig-parser","description":"A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.","version":"0.1.1","homepage":"https://dreamproduction.com","author":{"name":"Dream Production","email":"contact@dreamproduction.com"},"repository":{"type":"git","url":"git://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser"},"bugs":{"url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/issues"},"licenses":[{"type":"MIT","url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/tree/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"^0.9.2","grunt-contrib-clean":"^0.5.0","grunt-contrib-nodeunit":"^0.3.3","grunt":"~0.4.5"},"keywords":["gruntplugin"],"main":"Gruntfile.js","directories":{"test":"test"},"dependencies":{},"license":"ISC","gitHead":"3a76b99ecb544103b09c37eb2d99479972924ee0","_id":"@dreamproduction/grunt-gettext-twig-parser@0.1.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"florin.sarba","email":"florin@dreamproduction.com"},"dist":{"integrity":"sha512-KFMN+MMspEmOiIrVcOKhZoV4xmIvWfu7Yx9E2N2rP/76NNyXoaD81gDlmDzT+bm2ELFCsc+M6snHPWkrtTpjTw==","shasum":"6e3207db4e39bae0e3ac60bfc6455c94e93420c8","tarball":"https://registry.npmjs.org/@dreamproduction/grunt-gettext-twig-parser/-/grunt-gettext-twig-parser-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApo6la8VuQFf9r+JRprRDGnCKvR/lEyzUOR8rLQVtdVAiEAyTusr0BPOd6/TZWRsPCVlWoTcSX4nuf0DkTxiCVYsHU="}]},"maintainers":[{"email":"mircea@dreamproduction.com","name":"mircea.tihu"},{"email":"florin@dreamproduction.com","name":"florin.sarba"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-gettext-twig-parser-0.1.1.tgz_1506595287176_0.07906799647025764"}},"0.1.2":{"name":"@dreamproduction/grunt-gettext-twig-parser","description":"A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.","version":"0.1.2","homepage":"https://dreamproduction.com","author":{"name":"Dream Production","email":"contact@dreamproduction.com"},"repository":{"type":"git","url":"git://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser"},"bugs":{"url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/issues"},"licenses":[{"type":"MIT","url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/tree/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"^0.9.2","grunt-contrib-clean":"^0.5.0","grunt-contrib-nodeunit":"^0.3.3","grunt":"~0.4.5"},"keywords":["gruntplugin"],"main":"Gruntfile.js","directories":{"test":"test"},"dependencies":{},"license":"ISC","gitHead":"acbd63458e502cfd71809f4eded57e4b8a92333b","_id":"@dreamproduction/grunt-gettext-twig-parser@0.1.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"florin.sarba","email":"florin@dreamproduction.com"},"dist":{"integrity":"sha512-mlsUJh8Z+ASyHPMWDa3+du5tB2aG1X++Uo/IRt+iHQOP1CGiM/smwR1YnHgEr0x1QKjeTkZO6jsLiy+Fqkw7HA==","shasum":"7b5556a0520181e8646dd4608e445e2f542b6e44","tarball":"https://registry.npmjs.org/@dreamproduction/grunt-gettext-twig-parser/-/grunt-gettext-twig-parser-0.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+t70NbHJPvcYe/oUp/om3Q8dV8+YUHRJJniaNZAK2vAiEA8GBm0lSPaCS+MrAF/xNws5yp2uXn/kDRNim82Kt0yXg="}]},"maintainers":[{"email":"florin@dreamproduction.com","name":"florin.sarba"},{"email":"mircea@dreamproduction.com","name":"mircea.tihu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-gettext-twig-parser-0.1.2.tgz_1506684518790_0.49564667139202356"}},"0.1.3":{"name":"@dreamproduction/grunt-gettext-twig-parser","description":"A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.","version":"0.1.3","homepage":"https://dreamproduction.com","author":{"name":"Dream Production","email":"contact@dreamproduction.com"},"repository":{"type":"git","url":"git://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser"},"bugs":{"url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/issues"},"licenses":[{"type":"MIT","url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/tree/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"^0.9.2","grunt-contrib-clean":"^0.5.0","grunt-contrib-nodeunit":"^0.3.3","grunt":"~0.4.5"},"keywords":["gruntplugin"],"main":"Gruntfile.js","directories":{"test":"test"},"dependencies":{},"license":"ISC","gitHead":"2989cd3b84b2cc1f4fc5a8ed6806711022f3e391","_id":"@dreamproduction/grunt-gettext-twig-parser@0.1.3","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"florin.sarba","email":"florin@dreamproduction.com"},"dist":{"integrity":"sha512-jsUXIypaK9d4PBin9D2j1bArXb+0i4pp2dbth03/NlSko56LUNh8NYweHVds2xTMqkdYGQJXqIcbdWa9eBsfsQ==","shasum":"18526a5149fe1a1cd4c2351f52e71adaf34e30b9","tarball":"https://registry.npmjs.org/@dreamproduction/grunt-gettext-twig-parser/-/grunt-gettext-twig-parser-0.1.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsoNOWMVOI5h089hPY5jwM9QvbInb7Ju/Ht070Mncy7QIhAIUFaAwO4jrTMjWkXZ4+8Ccpdv1gUYlixOABsr1PLg1M"}]},"maintainers":[{"email":"florin@dreamproduction.com","name":"florin.sarba"},{"email":"mircea@dreamproduction.com","name":"mircea.tihu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-gettext-twig-parser-0.1.3.tgz_1506691215550_0.5954277636483312"}},"0.1.4":{"name":"@dreamproduction/grunt-gettext-twig-parser","description":"A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.","version":"0.1.4","homepage":"https://dreamproduction.com","author":{"name":"Dream Production","email":"contact@dreamproduction.com"},"repository":{"type":"git","url":"git://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser"},"bugs":{"url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/issues"},"licenses":[{"type":"MIT","url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/tree/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"^0.9.2","grunt-contrib-clean":"^0.5.0","grunt-contrib-nodeunit":"^0.3.3","grunt":"~0.4.5"},"keywords":["gruntplugin","twig","gettext","twig translation","grunt pot"],"main":"Gruntfile.js","directories":{"test":"test"},"dependencies":{},"license":"ISC","gitHead":"f2bb485198c49074f3dd0cf9bf65ede902154309","_id":"@dreamproduction/grunt-gettext-twig-parser@0.1.4","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"florin.sarba","email":"florin@dreamproduction.com"},"dist":{"integrity":"sha512-M/2nG6Upe8CJ0+uHrLtmZDQpXN9DLYRTik8CGl6IkKjRNItDhtqMrm+gjneG2fxdrrHjpEuRUZ0s+3vjA/smNw==","shasum":"7b48371bd77a827b8760847369c20f806591f350","tarball":"https://registry.npmjs.org/@dreamproduction/grunt-gettext-twig-parser/-/grunt-gettext-twig-parser-0.1.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKxEudswhuWeiTGhZdmzp/ypflx1zvthrqiF0NKwjfuwIgfe1puLqAlnBalB7UOHWEjpag1c/9F8GzKrfB1ufhulY="}]},"maintainers":[{"email":"florin@dreamproduction.com","name":"florin.sarba"},{"email":"mircea@dreamproduction.com","name":"mircea.tihu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-gettext-twig-parser-0.1.4.tgz_1506954233968_0.4534929757937789"}},"0.1.5":{"name":"@dreamproduction/grunt-gettext-twig-parser","description":"A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.","version":"0.1.5","homepage":"https://dreamproduction.com","author":{"name":"Dream Production","email":"contact@dreamproduction.com"},"repository":{"type":"git","url":"git://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser"},"bugs":{"url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/issues"},"licenses":[{"type":"MIT","url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/tree/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"^0.9.2","grunt-contrib-clean":"^0.5.0","grunt-contrib-nodeunit":"^0.3.3","grunt":"~0.4.5"},"keywords":["gruntplugin","twig","gettext","twig translation","grunt pot"],"main":"Gruntfile.js","directories":{"test":"test"},"dependencies":{},"license":"ISC","gitHead":"fa0bd116b9f7b07ba698ceb0c8ed87ea34c1dce4","_id":"@dreamproduction/grunt-gettext-twig-parser@0.1.5","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"florin.sarba","email":"florin@dreamproduction.com"},"dist":{"integrity":"sha512-w5sT99JZ7sGH+O/G3f8GdM5pkbZgxS240XbR/6ABEHHe1sNE+HX0un/KUMDgzEaKG7Do5G+oJPX7C396HdGTow==","shasum":"9e03102933b5eaa114e9a0c38516238a5a604ad0","tarball":"https://registry.npmjs.org/@dreamproduction/grunt-gettext-twig-parser/-/grunt-gettext-twig-parser-0.1.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICuvYfHx6UI6JXQlEFTjQa5QwqWtW7ZtQN24OPv4KTN1AiEAi64M5hXpC4ZPGaFwsNaPqWb41hqkl0+brQkJJhEo9y8="}]},"maintainers":[{"email":"florin@dreamproduction.com","name":"florin.sarba"},{"email":"mircea@dreamproduction.com","name":"mircea.tihu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-gettext-twig-parser-0.1.5.tgz_1516369124689_0.6760611701756716"}}},"readme":"[![npm (scoped)](https://img.shields.io/npm/v/@dreamproduction/grunt-gettext-twig-parser.svg)](https://www.npmjs.com/package/@dreamproduction/grunt-gettext-twig-parser) [![npm](https://img.shields.io/npm/dt/@dreamproduction/grunt-gettext-twig-parser.svg)](https://www.npmjs.com/package/@dreamproduction/grunt-gettext-twig-parser)\n# grunt-gettext-twig-parser\n\n> A grunt task that parses i18n twig strings and creates a PHP file with all the calls readable by the grunt-pot task.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.5`\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 @dreamproduction/grunt-gettext-twig-parser --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('@dreamproduction/grunt-gettext-twig-parser');\n```\n\n## The \"gettext_twig_parser\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `gettext_twig_parser` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  gettext_twig_parser: {\n      custom_options: {\n          options: {\n              textdomain: 'bar',\n              add_textdomain: true\n          },\n          files: {\n              'tmp/gettext_twig_parser_output.php': [ '**/*.twig', '!node_modules/**' ]\n          }\n      }\n  }\n});\n```\n\n### Options\n\n#### options.textdomain\nType: `String|null`\nDefault value: `null`\n\nA string value that matches your text domain.\n\n#### options.add_textdomain\nType: `Bool`\nDefault value: `true`\n\nA boolean value that specifies if the text domain should be appended to the output file.\n\n### Usage Examples\n\n#### Default Options\nIn this example, the default options are used to generate the PHP file. So if the `test.twig` file has the content `{{ __('foo', 'bar') }}`, the generated result would be `__( 'foo', 'bar' );` in the `gettext_twig_parser_test.php` file.\n\n```js\ngrunt.initConfig({\n  gettext_twig_parser: {\n    default_options: {\n      options: {\n          textdomain: 'bar',\n          add_textdomain: true\n      },\n      files: {\n          'tmp/gettext_twig_parser_test.php': ['test/fixtures/test.twig', 'test/fixtures/test.php']\n      }\n    }\n  }\n});\n```\n\n#### Null Text Domain Options\nIn this example, the default options are used to generate the PHP file. So if the `test.twig` file has the content `{{ __('foo', 'bar') }}` and `{{__(\"bar\", \"foo\")}}`, the generated result would be `__( 'foo', 'bar' );` and `__( 'bar', 'foo' );` in the `gettext_twig_parser_test_null_textdomain.php` file.\n\n```js\ngrunt.initConfig({\n  gettext_twig_parser: {\n    null_textdomain: {\n      options: {\n          textdomain: null,\n          add_textdomain: true\n      },\n      files: {\n          'tmp/gettext_twig_parser_test_null_textdomain.php': ['test/fixtures/test.twig', 'test/fixtures/test_null_textdomain.php']\n      }\n    }\n  }\n});\n```\n\n#### No Text Domain Options\nIn this example, the default options are used to generate the PHP file. So if the `test.twig` file has the content `{{ __('foo', 'bar') }}`, the generated result would be `__( 'foo' );` in the `gettext_twig_parser_test_no_textdomain.php` file.\n\n```js\ngrunt.initConfig({\n  gettext_twig_parser: {\n    no_textdomain: {\n      options: {\n          textdomain: 'bar',\n          add_textdomain: false\n      },\n      files: {\n          'tmp/gettext_twig_parser_test_no_textdomain.php': ['test/fixtures/test.twig', 'test/fixtures/test_no_textdomain.php']\n      }\n    }\n  }\n});\n```\n\n#### Example To Use With Grunt Pot\nThis example will create a new task `pot-twig` which will clean the temporary directory, parse the twig files and generate the PHP file, genearate the `pot` file and then clean the temporary directory again.\n```js\ngrunt.initConfig({\n\n        // ...\n\n        clean: {\n            tests: ['src/tmp']\n        },\n\n        gettext_twig_parser: {\n            default_options: {\n                options: {\n                    textdomain: 'bar',\n                    add_textdomain: true\n                },\n                files: {\n                    'src/tmp/gettext_twig_parser_output.php': [ '**/*.twig', '!node_modules/**' ]\n                }\n            }\n        },\n        \n        pot: {\n            options: {\n                // ...\n            },\n            files: {\n                // ...\n                src: [ '**/*.php' ] // Make sure to include the PHP file generated from the twig files ('src/tmp/gettext_twig_parser_output.php').\n                // ...\n            }\n        }\n        \n        // ...\n\n    });\n\n    // ...\n    grunt.loadNpmTasks('grunt-contrib-clean');\n    grunt.loadNpmTasks('@dreamproduction/grunt-gettext-twig-parser');\n    grunt.loadNpmTasks('grunt-pot');\n    // ...\n\n    grunt.registerTask('pot-twig', ['clean', 'gettext_twig_parser', 'pot', 'clean']);\n    // ...\n```\n\n## Supported Translation Functions\n- __()\n- _x()\n- _n()\n- _nx()\n- _n_noop()\n- _nx_noop()\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","maintainers":[{"email":"florin@dreamproduction.com","name":"florin.sarba"},{"email":"mircea@dreamproduction.com","name":"mircea.tihu"}],"time":{"modified":"2022-04-05T05:37:49.732Z","created":"2017-09-28T08:57:24.236Z","0.1.0":"2017-09-28T08:57:24.236Z","0.1.1":"2017-09-28T10:41:28.047Z","0.1.2":"2017-09-29T11:28:39.674Z","0.1.3":"2017-09-29T13:20:16.497Z","0.1.4":"2017-10-02T14:23:55.704Z","0.1.5":"2018-01-19T13:38:45.603Z"},"homepage":"https://dreamproduction.com","keywords":["gruntplugin","twig","gettext","twig translation","grunt pot"],"repository":{"type":"git","url":"git://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser"},"author":{"name":"Dream Production","email":"contact@dreamproduction.com"},"bugs":{"url":"https://git.dreamproduction.com/wordpress.utils/grunt-gettext-twig-parser/issues"},"license":"ISC","readmeFilename":"README.md","users":{"florin.sarba":true}}