zewa666 / aurelia-i18next

An Aurelia-Wrapper for the i18next library
MIT License
17 stars 15 forks source link

Translating after condition change #32

Closed Mordred closed 9 years ago

Mordred commented 9 years ago
<div class="alert alert-info" if.bind="showInfo">
  <span t="Translate">Not translated</span>
</div>

If the showInfo becomes true, translations are not evaluated and the Not translated text will be displayed.

zewa666 commented 9 years ago

I have a fix but its not complete for release as I'm missing one part. In order to make this work we'd simply have to create an Aurelia Custom Attribute out of your used Translation-Attributes. Inside there, whenever the value changes or the thingy is initialized the first time, we can call the translation service automatically.

Now the only problem that I've left is to learn how to register an attribute with multiple names so that whatever the user provides can be used as the alias for the custom attribute.

zewa666 commented 9 years ago

Ok so at least for your current approach with naming the attribute t the recent update should already solve your problem. Please report back if any other issues arise, will get the alias registration done in the meantime

Mordred commented 9 years ago

Nice, it's working now for t attribute. Thanks

zewa666 commented 9 years ago

Great, thx for the feedback

zewa666 commented 9 years ago

@Mordred the recent update now also introduces aliases

Mordred commented 9 years ago

Nice .. very good job