airbnb/polyglot.js — pull request #11 by olivierbeaulieu (2014-05-22 14:09:20+00:00)
Title: Support phrases in nested JSONs through the t() method

I migrated to polyglot from another library that allowed nested JSONs as such:

```js
var polyglot = new Polyglot({
phrases: {
"hello": "Hello",
"actions": {
"delete": "Delete",
"add": "Add"
}
}
});

polyglot.t('actions.add') // "Add"
```

This wasn't possible with Polyglot so I added it. Simply add allowNestedJSON: true when instantiating Polyglot, and it'll work.

I know there's a similar PR opened, but I think it's cleaner to have everything pass through the t() method.

Let me know what you think.