angular-bootstrap-toggle
angular-bootstrap-toggle copied to clipboard
Translation does not load from angular-translate
I believe this to be an issue of loading partial translation files. So the data isn't loaded when you grab it, but is loaded async later. See http://i.imgur.com/F03133N.jpg for the problem.
Code used:
<toggle ng-model="jackOfAllTradesToggle" on="{{'JACK_OF_ALL_TRADES' | translate}}" off="{{'JACK_OF_ALL_TRADES' | translate}}" onstyle="btn-success" offstyle="btn-danger"></toggle>
I've verified that it does not exist when the files are loaded locally: http://plnkr.co/edit/KoxNXyUnN4te54yjnwrH?p=preview
plnkr does not allow loading partial translation files or I'd provide a reproduction for that.
Please let me know if I can provide further details.
It randomly started working...closing issue
Actually. It loads fine the first time, but any additional refresh loads the wrong text.
Thanks for your feedback. It could be a great help to figure out the root cause, if you can provide more information about 'additional refresh'.
So on first load of the page it works, but then if the page is refreshed the translation is lost.
Cannot reproduce it on plnkr yet as I believe it's related to the async call to the external translation file which doesn't seem to work on plnkr, but I'll see if I can find an example where loading partials works on plnkr.
it seems the translate issue appears in 0.1.3 again. it works for 0.1.2
it seems the translate issue appears in 0.1.3 again. it works for 0.1.2
Hi,
had the same issue in the 0.4.2 release. Solution that worked for me is adding the following lines at the beginning of the computeStyle declaration:
var onElement = angular.element(self.onElement); var offElement = angular.element(self.offElement); onElement.html(self.on); offElement.html(self.off);
Hope that helps you too.