Mindflash / grunt-jsxgettext

2 stars 11 forks source link

grunt-jsxgettext

Build Status

A Grunt task to run jsxgettext extracting strings and creating POT files.

Example

grunt.initConfig({
  jsxgettext: {
    test: {
      files: [
        {
          src: ['tests/fixtures/**/*.*js', '!ignored'],
          output: 'test.po',
          'output-dir': './translations/'
        }
      ],
      options: {
        keyword: ['gettext']
      }
    }
  }
})

Options

**** generators

Type: 'String' or 'function' Default:

[
    {ext: '.ejs': generator: jsxgettext.generateFromEJS},
    {ext: '.hbs', generator: jsxgettext.generateFromHandlebars},
    {ext: '.jade', generator: jsxgettext.generateFromJade},
    {ext: '.swig', generator: jsxgettext.generateFromSwig} 
]

Used to add/modify mapping between file extensions and generators (parsers) used by jsxgettext.

This can be one of the following:

Getting Started

This plugin requires Grunt ~0.4.2

npm install grunt-jsxgettext --save-dev

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-jsxgettext');