【发布时间】:2019-06-17 04:21:22
【问题描述】:
我在使用 i18next 进行翻译时收到错误 Unexpected token ) while compiling ejs。
我已经用i18next实现了翻译,下面是如下代码,使用map函数时出现如下错误
en.json
{
"title": "List of Countries",
"list":[{
"name": "Singapore",
"code": "SG"
},{
"name": "Thailand",
"code": "TH"
}]
}
index.ejs
<h4><%=t('title')%></h4> //outputs correctly
<ul>
<%=t('list').map(e=>{%>
<li><%=e.name%></li>
<%})%>
</ul>
【问题讨论】:
标签: javascript html node.js ejs i18next