This question says it all. If I put the HTML directly in the translation file (JSON formatted), for example:
"test_html" : "click <a href='http://stackoverflow.com/'>here</a>",
I get this in my HTML:
click <a href=&
I also tried combining this in my translation file:
"test_html_placeholder" : "click %shere%s",
With this in my HTML:
<%= __('test_html_placeholder', '<a href="http://stackoverflow.com">', '</a>') %>
But similar results were obtained.
The only thing I can find is clumsiness:
"test_html_pre" : "click ", "test_html_link" : "here", "test_html_post" : ".",
with this:
<%= __('test_html_pre') %><a href="http://stackoverflow.com"><%= __('test_html_link') %></a><%= __('test_html_post') %>
But this is so cumbersome that it is almost not worth doing, and, in addition, the word order in some languages ββforced me to put some empty lines in my translation files, which i18n-node apparently do not like, gives the name of the key (attribute), when it encounters an empty string.
I also tried using the "\" character as an escape character in front of the characters, but I received an invalid JSON error when I raised the sails (restarting the server).
Any ideas, workarounds? I use sails.js, this is not my solution, but I am stuck in it and it comes with i18n-node. At the end of this day in this project I would like to consider the possibility of using another library, but I do not completely exclude it.