Skip to content

Commit

Permalink
Refer to the website for documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenv committed Sep 24, 2013
1 parent c432fc3 commit 2e4f7b6
Showing 1 changed file with 1 addition and 69 deletions.
70 changes: 1 addition & 69 deletions README.md
Expand Up @@ -6,76 +6,8 @@ Used in combination with [`angular-gettext`](https://github.com/rubenv/angular-g

[![Build Status](https://travis-ci.org/rubenv/grunt-angular-gettext.png?branch=master)](https://travis-ci.org/rubenv/grunt-angular-gettext)

## Getting Started
This plugin requires Grunt `~0.4.1`
Check the website for usage instructions: [http://angular-gettext.rocketeer.be/](http://angular-gettext.rocketeer.be/).

If 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:

```shell
npm install grunt-angular-gettext --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-angular-gettext');
```

## The "nggettext_extract" task

Extracts translations from your Angular.JS templates and generates a gettext-compatible `.pot` file.

In your project's Gruntfile, add a section named `nggettext_extract` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
nggettext_extract: {
pot: {
'po/myApp.pot': ['src/views/*.html', 'src/js/*.js']
},
},
})
```

## The "nggettext_compile" task

Compiles a `.po` file into a angular-gettext JavaScript definition.

In your project's Gruntfile, add a section named `nggettext_compile` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
nggettext_compile: {
all: {
'src/js/translations.js': ['po/*.po']
},
},
})
```

Optionally, you can specify a `module` parameter, which defines the Angular.JS module for which the translations JavaScript is generated:

```js
grunt.initConfig({
nggettext_compile: {
all: {
options: {
module: 'myApp'
},
files: {
'src/js/translations.js': ['po/*.po']
}
},
},
})
```


## Contributing
All code lives in the `src` folder and is written in CoffeeScript. Try to stick to the style conventions used in existing code.

Tests can be run using `grunt test`. A convenience command to automatically run the tests is also available: `grunt watch`. Please add test cases when adding new functionality: this will prove that it works and ensure that it will keep working in the future.

## License

(The MIT License)
Expand Down

0 comments on commit 2e4f7b6

Please sign in to comment.