How can I use translations in i18next in javascript

两盒软妹~` 提交于 2019-12-02 05:37:59

It should be alert(t(someKey)) (see http://i18next.com/ at end of page).

Having read the homepage of the project...

i18n.init(function(t) {
    // translate nav
    $(".nav").i18n();

    // programatical access
    var appName = t("app.name");
});

That last part is what you're looking for. It's important to note that that t is passed to the init callback as a parameter - you can't just blindly call t() anywhere ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!