Using i18n in custom element

I have a custom element which I refer to as follows:

<simple-cost costing.bind="costing" costings-list.bind="" costing-value.bind="costing.servicesValue"

  t="[headertitle]" headertitle="Monthly costs for utilities"      

  t="[coststitle]" coststitle="All costs are per month"                
  t="[headerinfo]" headerinfo="These costs are entered into the cash flow on a monthly basis."
  t="[pricetitle]" pricetitle="per month" 


The problem is that I am referring to t= multiple times, and only
is picked up, the subsequent ones are ignored.

How do I get i18n to translate each of the attributes in this custom element?

1 Like

Instead of using multiple t attributes use semi-colons as the docs suggest:

  <span t="[html]title;[class]title-class">Title</span>
1 Like

Thanks very much - exactly what I needed


Interesting. I couldn’t get it to work in my custom element. Instead I had to do

<span class="${title-class | t}">${title | t}</span>