i18next / jquery-i18next

jQuery-i18next is a jQuery based Javascript internationalization library on top of i18next. It helps you to easily internationalize your web applications.
https://locize.com/blog/jquery-i18next/
MIT License
170 stars 83 forks source link

jqueryI18next.init is not a function(…) #25

Closed aristot closed 7 years ago

aristot commented 8 years ago

I have an error : jqueryI18next.init is not a function(…) which seems be resolved ?

var i18next = require('i18next'); var i18nextInstance = i18next.createInstance(); var jqueryI18next = require('jquery-i18next'); var initialize = function () { var router, browse;

i18next.init({ lng: 'fr',

}, function(err, t) { // for options see // https://github.com/i18next/jquery-i18next#initialize-the-plugin jqueryI18next.init(i18next, $); // start localizing, details: // https://github.com/i18next/jquery-i18next#usage-of-selector-function $("body").localize(); browse = BrowseApp.initialize(); return Backbone.history.start({ pushState: true });; });

jamuhl commented 8 years ago

could you try with jquery-i18next@1.2.0

aristot commented 8 years ago

thanks this change works but I have a new bug

var template = _.template(NavTemplate)(data); this.$el.html(template); this.$el.i18n(); Backbone.history.navigate('/hise', { trigger: true }); return this;

nav_view.js:173 Uncaught TypeError: this.$el.i18n is not a function(…)

jamuhl commented 8 years ago

as long you did not override it should be this.$el.localize();

jamuhl commented 7 years ago

closing...feel free to reopen if still not solved.