[英]i18n error --translation tags not working
I want to use the i18n translation function for a string containing html tags and text. 我想对包含html标签和文本的字符串使用i18n转换功能。 My js program returns this string for backend Purpose.
我的js程序将此字符串返回给后端。 This is how I used the function:
这就是我使用该函数的方式:
i18n.t("Manage your subscriptions__-link__ on your Streams page__-closelink__.",{link:'<a href="#streams/all">',closelink:'</a>'});
The link '<a href="#streams/all">'
is being translated into <a href=\\'#streams/all\\'>
. 链接
'<a href="#streams/all">'
已转换为<a href=\\'#streams/all\\'>
。
that is escaped...default on i18next is set to escape interpolated content to save you from xss attacks. 已逸出... i18next的默认设置为逸出插值内容,以使您免受xss攻击。
you can unescape -> learn more https://www.i18next.com/interpolation.html#unescape 您可以unescape->了解更多信息https://www.i18next.com/interpolation.html#unescape
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.