i18next / ng-i18next

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

Only re-initialize i18next when options change #29

Closed venables closed 10 years ago

venables commented 10 years ago

Angular seems to trigger the $watch on $i18nextTanslate.options mutliple times with the same value, which causes i18next to ge re-initialized unnecessarily. This is especially bad when we dynamically load resources (it downloads the translation file multiple times).

This change adds a small check to prevent re-initialization of i18next when given the same options.

bugwelle commented 10 years ago

Thank you :+1: :) I'll update to next version later.