javascript - i18next Displayed key instead of value -
i have translation.json file in /locales/en/
{ "app": { "name": "example app" } } in html, have:
<a href="/" data-i18n="app.name"> in js:
$(document).ready(function() { var language_complete = navigator.language.split("-"); var language = (language_complete[0]); console.log('language', language); $.i18n.init({ lng: language, fallbacklng: false, debug: false }, function() { $('a').i18n(); }); }); it displayed app.name instead of example app. missed in code? thanks
you have set uselocalstorage , usedataattroptions true
$.i18n.init({uselocalstorage: true , usedataattroptions:true, ....});
Comments
Post a Comment