Tag: anchor

node.js:有没有办法将HTML放入i18n-node JSON转换文件?

这个问题说明了一切。 如果我把HTML直接放入(JSON格式)的翻译文件中,像这样: "test_html" : "click <a href='http://stackoverflow.com/'>here</a>", 我在我的HTML中得到这个: click &lt;a href='http://stackoverflow.com/'&gt;here&lt;/a&gt; 我也尝试在我的翻译文件中结合这个: "test_html_placeholder" : "click %shere%s", 有了这个在我的HTML: <%= __('test_html_placeholder', '<a href="http://stackoverflow.com">', '</a>') %> 但得到了类似的结果。 我唯一能工作的就是这种笨拙: "test_html_pre" : "click ", "test_html_link" : "here", "test_html_post" : ".", 有了这个: <%= __('test_html_pre') %><a href="http://stackoverflow.com"><%= __('test_html_link') %></a><%= __('test_html_post') %> 但是这样做太麻烦了,几乎不值得去做,而且在某些语言中的字顺序会迫使我在我的翻译文件中放一些空的string,而i18n-node似乎并不喜欢,因为它吐出了关键字属性)名称,当它遇到一个空string。 我也尝试在符号前使用“\”作为转义字符,但是当我解除帆(重新启动服务器)时,我得到了无效的JSON错误。 任何想法,解决方法? 我正在使用sails.js,这不是我的决定,但我坚持它,它与i18n节点。 这个项目当天晚些时候考虑使用另一个图书馆,但不是完全不可能。