aurelia/i18n

t-params disapears

Closed this issue · 3 comments

Hi,

When I use t-params attribute to attribute data to my locale, the variable is displayed, then emptied. The bug does not occurs if I use the filter t. You can see the bug in this video : https://www.dropbox.com/s/y69ixjjlp5gmnye/aurelia-bug-i18n.mov?dl=0

My code is just:

<button
    t="mykey"
    t-params.bind="{foo: foo}">
  </button>
  ${'mykey'|t:{foo: foo}}

I have the same problem. I found a temporary workaround based on this comment: #104 (comment):

In the HTML:

<span t="global.name" t-params.bind="nameParams">Name</span>

In the JS:

// Init this.nameParams somewhere.
ea.subscribe('i18n:locale:changed', payload => {
    this.nameParams = {playerName: this.me.name};
});

I proposed a patch in #130. In the mean time, you can set aurelia-i18n to git+https://github.com/Jenselme/i18n.git#jen-rel in your package.json to get my patched version which solved it for me.