martinandert / counterpart

A translation and localization library for Node.js and the browser.
MIT License
242 stars 25 forks source link

Improve onTranslationNotFound callback #41

Closed 11bit closed 7 years ago

11bit commented 7 years ago

Hi Martin,

I want to use onTranslationNotFound event listener for missing translations tracking. But unfortunately it doesn't provide missing key's scope so it is hard to locate a problem when there are a lot of scoped translations with the same key.

What do you think about adding scope to callback arguments?

translate.onTranslationNotFound(function(locale, key, fallback, scope) {
  ...
});
martinandert commented 7 years ago

Thanks, Ivan! I've just merged it and released v0.17.8. Enjoy!

11bit commented 7 years ago

Cool. Thanks!