jamuhl/i18next — pull request #193 by franck34 (2014-01-13 14:25:22+00:00)
Title: Possibility to hook i18n when returned value for a key is an object rathern than a string

Possibility to hook i18n when returned value for a key is an object rathern than a string.

(NB: not sure i'm not reinventing the wheel i.e "context" stuff)

Exemple:

* jsonfile

```
{
"myKey":{
"FOO":"myFoo",
"BAR":"myBar"
}
```

* javascript

```
i18n.init({
objectKeyHandler : function(ns,key,lg) {
if (someWebAppCondition) {
var n = ns+':'+key+'.'+'FOO';
} else {
var n = ns+':'+key+'.'+'BAR';
}
return i18n.t(n);
},
[.... other init options ....]
});
```

* html

```

```