zewa666 / aurelia-i18next

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

router translations #36

Open flieks opened 9 years ago

flieks commented 9 years ago

hi,

i know there is another issue about this but i'm trying to translate like this in my nav-bar custom element:

<ul >
          <li repeat.for="route of router.navigation">
                  <a href.bind="route.href">
                            <!--<span t="route.title"></span>     this doesn't work  -->
                            ${route.title | t}
                  </a>
        </li>
</ul>

it only gets translated once at startup. Never when i change the language (setLocale and even with this.i18n.updateTranslations(this.element); which is called). The rest of my site is translated ok.

thanks

zewa666 commented 9 years ago

Hi there, sry to say but this is currently not possible with ValueConverter-based translations as we need a new feature called signaling. That would allow us to signal VCs about changes so they know when to re-render.

The alternative would be to use attribute based translation, but as you pointed out there is currently a bug https://github.com/aurelia/templating/issues/154.

Hold on we'll get it done hopefully soon

flieks commented 9 years ago

thanks zewa, i will keep an eye on that issue