internationalizationaureliai18next

Aurelia - I18N on options of a select


I would like to translate the options of my select but I do not know how to do that :

<select>
    <option repeat.for="element of elementList" model.bind="element.id">
      ${element.value}   <== How to translate the value ?
    </option>
</select>

Could you please help me ?


Solution

  • The value would have to be a key in your translation file. Then you'd simply use the t binding behavior:

    ${element.value & t}

    This would work for a model.bind expression as well, but that might not be what you want.