I wrote I18nJS (https://github.com/yoannmoinet/i18njs) more than two years ago.
TLDR; We had a really specific need.
Deep inside me, I knew I was reinventing the wheel.
Even though we had a very specific need, I sold it to my boss firstly to be able to do some open-source work. It was one of my first open source projects.
Concretely, we needed a very simple i18n lib, that could easily be plugged into Handlebars and RequireJS (OMG, RequireJS).
But, more importantly, we needed some kind of deep dynamism in our locales. Meaning that we could use a templating engine to define our strings more dynamically.
It’s kind of hard to explain like that, but when you work on a public product, people (working on the product) define a set of words you HAVE to use to define certain things. Those words get updated a lot during the life of the product. And you need to keep updated all your translations. It’s both a marketing and a UX move. To keep the user familiar with repetitive terms, clearly defined, linked to your product.
With this we were able to use default translations across the app, defined only once.
We could write things like :
{
“fr”: { “punchline”: “Mon {{product}} est le meilleur”}
“en”: {“punchline”: “My {{product}} is the best”}
}
And have a hashtable of translated default values alongside all our locales. This would help us having product terms updated easily, without having to look into/update all translations.
It was very liked by the team in charge of the product definitions and wording.
Well, I hope this answers the question.