0

I'm using ember-intl and would like to translate html (href with link):

en-us.json:

{
   "sign-up": "Didn't get it? check your spam folder, or try to '<a {myLink}>'send a new passcode'</a>'",
}

My controller has an action that is called: signUp:

actions: {
    signUp: function() {
      console.log('success');
    },
}

In my hbs file, I tried:

{{{t 'sign-up' myLink=(action 'signUp')}}}

The text was set, and the link looks as a link, but when I click on this link, the log is not written.

Any help appreciated!

john remi
  • 45
  • 1
  • 4

1 Answers1

0

Check this thread in stackoverflow:

Combine linkTo and action helpers in Ember.js

probably after installing the library

ember-link-action

you can do something like

{{#link-to 'other-route' invokeAction=(action 'signUp')}}
  {{t 'sign-up'}}
{{/link-to}}
gabrimac
  • 526
  • 5
  • 7
  • Thank you! As I understand, the sign-up text will be clickable and not only: "send a new passcode". (I know I can separate my string in order to make this text clickable) – john remi Jul 08 '20 at 09:59