我已经使用i18next实现了翻译, https://github.com/i18next/i18next 我正在尝试迭代前端的嵌套数组,但无法在翻译模式下工作,https://www.i18next.com/translation-function/objects-and-arrays请帮助
en.json
{
"title": "List of Countries",
"list":[{
"name": "Singapore",
"code": "SG"
},{
"name": "Thailand",
"code": "TH"
}]
}
index.ejs
<h2><%=t("list.0.name")%></h2> //working fine
//using map not working
<% t("list").map(e=>{%>
<a href="#"><%=t(e.name)%></a>
<%})%>