Use link in subexpression

I often use the library ember-i18n, and sometimes I want to display a link in a translation.

In this example:

{{ t readmore link=(link-to 'top posts' 'posts') }}

my translation Read more on the {{ link }} page.

But the output is not as I expected, the generated link is not in the translation range, but before it:

<a id="ember1128" class="ember-view" href="/posts">top posts</a>
<span id="i18n-8">Read more on the  page.</span>

I expect it to be like this:

<span id="i18n-8">Read more on the <a id="ember1128" class="ember-view" href="/posts">top posts</a> page.</span>

Is there a way I can work around this?

+4
source share

Source: https://habr.com/ru/post/1545332/


All Articles