【发布时间】:2023-04-08 01:59:01
【问题描述】:
我正在将 Node.js 和 ExpressJS 与 node-Localize (https://github.com/AGROSICA/node-localize) 一起用于网站。
我有一个网页,其中包含由多个段落分隔的传记 (<p></p>)。
有没有办法在我的翻译文件中保存和呈现 html 语法和标签信息?
"Bio" : {
"en-US" : "<p>A first paragraphe of information</p><p>And a second one</p>",
"fr" : "<p>Un premier paragraphe d'information</p><p>Et un deuxième</p>"
}
/*And the html...*/
<%= translate("Bio")%>
因为我不想使用下面的语法
"BioParagraphe1" : {
"en-US" : "A first paragraphe of information",
"fr" : "Un premier paragraphe d'information"
},
"BioParagraphe2" : {
"en-US" : "And a second one",
"fr" : "Et un deuxième"
}
/*And the html...*/
<p>
<%= translate("BioParagraphe1")%>
</p>
<p>
<%= translate("BioParagraphe2")%>
</p>
【问题讨论】:
标签: node.js express localization