1
votes

How is it possible to select the proper namespace when translating html attributes? The default syntax is like:

<span i18n="home.title">Title</span>

For instance, in the view model the approach is the following:

this.i18n.tr('invalidName', {ns: 'errors'})

I'm using version 0.5.3 of aurelia-i18n.

1

1 Answers

1
votes

The best options I would suggest are:

<span t="errors:invalidName"></span>
<span t="invalidName" t-params.bind="{ns: 'errors'}"></span>
<span>${'errors:invalidName' | t & signal:'aurelia-translation-signal}</span>
<span>${'invalidName' | t:{ns: 'errors'} & signal:'aurelia-translation-signal}</span>