i18next / ng-i18next

translation for AngularJS using i18next
https://github.com/i18next/ng-i18next
MIT License
161 stars 54 forks source link

refactorize & add watch on i18next options #55

Closed qraynaud closed 10 years ago

qraynaud commented 10 years ago

This adds support for watching i18next options. Something like this:

<p ng-i18next>[i18next]({
  count: someScopeValue || 0
})ns:someKey</p>

was not refreshing the value when someScopeValue changed. This implicated a lot of changes so I got my sleeves up and came up with some changes to make the code easier to understand while retaining full compatibility with previous features.

Hope it helps.

qraynaud commented 10 years ago

Oh, I forgot to mention I also managed to get rid of the $rootScope.$digest() call. That's good because it should improve performances of applications using ng-i18next's directives a lot.

efolio commented 10 years ago

@archer96 This seems to be good to be merged. However, I need to know if we target IE8 or not.

bugwelle commented 10 years ago

Sorry, wasn't online for a few days.

@efolio Well, since angular 1.3 drops support for Internet Explorer 8, I don't see any reason to support it, too. So a polyfill for trim() is not necessary. But we should mention this in README.

Note: AngularJS 1.3 is dropping support for IE8. Read more about it on our blog. AngularJS 1.2 will continue to support IE8, but the core team does not plan to spend time addressing issues specific to IE8 or earlier. https://docs.angularjs.org/guide/ie

@qraynaud Thank you very much! :) Travis CI build passes, so merging this should be easy.