PascalLeMerrer/grunt-angular-gettext — pull request #1 by tkrotoff (2014-02-07 12:54:31+00:00)
Title: Re-indent and simplify isGetText() and isGetString()

Bien le bonjour ;)

Thanks a lot for the patch!
Small re-indent and simplification, unit tests are passing + tested on my AngularJS app.
This way your patch gets more chances to get accepted upstream.

I've forked your fork because I prefer to write [this](https://github.com/rubenv/angular-gettext/issues/19#issuecomment-33545498) (not included in this patch - just wanted to know if you are interested):

```JavaScript
tr('Something went wrong: {{error}}, please reload', {error: error});
```

instead of

```JavaScript
gettextCatalog.getString(gettext('Something went wrong: {{error}}, please reload', {error: error}));
```

This can be done thanks to your patch + a new factory:

```JavaScript
app.factory('tr', ['gettext', 'gettextCatalog', function(gettext, gettextCatalog) {
return function(string, dataObject) {
return gettextCatalog.getString(gettext(string), dataObject);
};
}]);
```

and patched function `isGetText()` inside grunt-angular-gettext:

```JavaScript
function isGetText(node) {
return node !== null &&
node.type === 'CallExpression' &&
node.callee !== null &&
(node.callee.name === 'gettext' || node.callee.name === 'tr') && <===
node.arguments !== null &&
node.arguments.length;
}
```