Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation does not load from angular-translate #1

Open
mlenser opened this issue Nov 28, 2015 · 6 comments
Open

Translation does not load from angular-translate #1

mlenser opened this issue Nov 28, 2015 · 6 comments

Comments

@mlenser
Copy link

mlenser commented Nov 28, 2015

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.

@mlenser
Copy link
Author

mlenser commented Nov 28, 2015

It randomly started working...closing issue

@mlenser mlenser closed this as completed Nov 28, 2015
@mlenser
Copy link
Author

mlenser commented Nov 28, 2015

Actually. It loads fine the first time, but any additional refresh loads the wrong text.

@mlenser mlenser reopened this Nov 28, 2015
@ziscloud
Copy link
Owner

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'.

@mlenser
Copy link
Author

mlenser commented Nov 29, 2015

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.

ziscloud added a commit that referenced this issue Dec 7, 2015
@tcp-wegener
Copy link

it seems the translate issue appears in 0.1.3 again.
it works for 0.1.2

@mmaaddaass
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants