Question

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.

Was it helpful?

Solution

I solve my problem. I was loading jquery twice , so when the second jquery was loaded it unload every jquery plugins.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top