I'm trying to re-run the string replace that Magento runs upon load for language translation. The reason for this is I have injected HTML (via AJAX) that happens at any point after the page load has completed.

1 Answer 1


You are talking about the php one __() or the JS one?

The PHP translation NO, because it works server side, but you can translate the stuff in the AJAX request.

The JS one is injected here:


And I think if generate a second Translate object it might work.

  • Thank you. I will try that method and if that doesn't work, I will translate the data before it gets sent in the AJAX call
    – Ste
    Aug 22, 2014 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.