Skip to content

Translation does not load from angular-translate #1

Description

@mlenser

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.

Activity

  1. mlenser commented on Nov 28, 2015

    @mlenser
    Author

    It randomly started working...closing issue

  2. mlenser commented on Nov 28, 2015

    @mlenser
    Author

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

  3. ziscloud commented on Nov 29, 2015

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

  4. mlenser commented on Nov 29, 2015

    @mlenser
    Author

    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.

  5. added a commit that references this issue on Dec 7, 2015
  6. tcp-wegener commented on Nov 7, 2017

    @tcp-wegener

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

  7. mmaaddaass commented on Jul 26, 2019

    @mmaaddaass

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions