我正在使用http://jamuhl.github.com/i18next/node/工作正常,但是对于一个我似乎无法解决的问题。
就是这样,我的 /locales/dev/translation.json 中有这个 translation.json 文件
{
"tzm": "Chapters - Zeitgeist Movement"
,"welcome": [
"<p>The Zeitgeist Movement is an explicitly non-violent, global sustainability advocacy group currently working in over 1000 Regional Chapters across 70 countries.</p>"
,"<p>The basic structure of The Movement consists of Chapters, Teams, Projects & Events. Overall, the Chapters are essentially what define the Movement and each Chapter works to not only spread awareness about the roots of our social problems today but also to express the logical, scientific solutions and methods we have at our disposal to update and correct the current social system and create a truly responsible, sustainable, peaceful, global society.</p>"
]
在我的刀片模板中,我有以下内容:
div#page
p=t("welcome")
问题是我得到了 html 标签,查看文档http://i18next.com/pages/sample.html专门设置内部 html:
使用 i18next-node 和显示段落部分的正确方法是什么,我之前的做法是:
,"welcome": {
"p1":"The Zeitgeist Movement is an explicitly non-violent, global sustainability advocacy group currently working in over 1000 Regional Chapters across 70 countries."
,"p2":"The basic structure of The Movement consists of Chapters, Teams, Projects & Events. Overall, the Chapters are essentially what define the Movement and each Chapter works to not only spread awareness about the roots of our social problems today but also to express the logical, scientific solutions and methods we have at our disposal to update and correct the current social system and create a truly responsible, sustainable, peaceful, global society."
}
然后我的 page.blade 模板看起来像:
div#page
p=t("welcome.p1")
p=t("welcome.p2")
对于少量数据,这可以正常工作,但是如果您有大量段落,它可能会变得无聊。