Closed alvarotrigo closed 6 years ago
I thought about using interpolation but noticed it only works for attributes? Was thinking of doing something like this:
<div class="demo" data-t-interpolate>
<div class="loading"></div>
{{My text here}}
</div>
This would also get rid of other issues such as texts with internal links:
<div data-t>My text is here <a href="whatever">and this is a link</a></div>
Which won't work properly at the moment as it will replace the whole text for the translation getting rid of the link.
This could be a possible solution?
<div data-t>{{My text is here}} <a href="whatever">{{and this is a link}}</a></div>
I know you could use the HTML option, but I don't see it as a good solution when there's plenty of links or html code inside an element containing text.
I think this should be fixed by your PR too, thanks.
You can also put a : <span data-t>your text</span>
around your text. I use it a lot, it works perfectly.
Having something like:
There's no easy way to translate the text "My text here" unless wrapped in a some kind of element.
Something similar occurs when using other frameworks such as Knockout.js, but the solution they adopted was allowing the use of HTML comments for those cases, so it would end up like this:
A solution like this would be great for this module. As far as I know I didn't find an easy way of dealing with theses cases. Correct me if I'm wrong.