aurelia / i18n

A plugin that provides i18n support.
MIT License
93 stars 70 forks source link

Cannot use namespaces when using the `$t(key)` markup in the `t` custom attribute #265

Open pmanu93 opened 6 years ago

pmanu93 commented 6 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: When using the attribute with combined translations, I can't use namespace because it breaks the translation. Example:

 <h4 t="$t(global.open) $t(app:activities)"></h4>

renders as

activities)

but

 <h4 t="$t(global.open) $t(global.open)"></h4>

renders as

Abrir Abrir

If I use t="app:activities" it works fine, so the problem must be related to the $t(key) markup

Expected/desired behavior:

zewa666 commented 6 years ago

I'm not sure we can really do a lot about that. Nevertheless this example seems like to be anyway better solved with two BindingBehaviors

<h4>${'global.open' & t) ${'app:activities' & t}</h4>
pmanu93 commented 6 years ago

That's what I ended up doing ... however I thought I should inform you, because in the i18next documentation it shows that this should be possible :)

zewa666 commented 6 years ago

I will look into this more closely