I solve my problem. I was loading jquery twice , so when the second jquery was loaded it unload every jquery plugins.
i18next : Object [object Object] has no method 'i18n'
-
06-10-2022 - |
Frage
I'm trying to use i18next.js with backbone.js but I get this error :
Uncaught TypeError: Object [object Object] has no method 'i18n'
Here is my html :
<body>
<ul class="menu">
<li><a href="#" data-i18n="menu.surname"></a></li>
<li><a href="#" data-i18n="menu.firstName"></a></li>
</ul>
</body>
here is my locales/en/translation.json :
{
"menu": {
"surname": "Name:",
"firstName": "First Name:"
}}
and here is my translation.js :
$(document).ready(function(){
language = "en";
i18n.init({ lng: language, debug: true }, function(t) {
$(".menu").i18n();
});
});
For now there is no langage detection , I only use "en" in static but it doesn't display anything.
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow