【问题标题】:i18next Module in ExpressJS and Client SideExpressJS 和客户端中的 i18next 模块
【发布时间】:2013-07-22 09:58:52
【问题描述】:

我在我的 NodeJs/ExpressJS Web 应用程序中使用 i18next 模块。

翻译文件在/locales文件夹中。

来自i18next.com,可以在客户端使用

<script type="text/javascript" src="[PATH]/i18next.js" />
...
<span href="#" data-i18n="nav.home"></span>

我通过npm install i18next安装了模块。

app.js,我设置了静态文件:

app.use(express.static(path.join(__dirname, 'public')));

如何在客户端引用i18next.js文件的路径?翻译文件的路径?

<script type="text/javascript" src="???" />

谢谢

【问题讨论】:

    标签: javascript node.js internationalization express i18next


    【解决方案1】:

    如果 locales 文件夹在公共目录中,那么它可以被称为 src="/locales/i18next.js"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-03
      • 1970-01-01
      • 1970-01-01
      • 2017-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多