I am developing a nodejs app.
Here is how I initialize i18next in app.js:
var i18n = require('i18next');
i18n.init({
saveMissing: true,
debug: true
});
Here is my js code:
...
// display strength based on score
switch (strength.score) {
case 0:
$('#strength-meter').removeClass()
$('#strength-meter').addClass('progress-bar progress-bar-danger')
$('.progress .progress-bar').css('width', '25%')
return 'very weak'
break;
...
I have tried using "return i18n.t('app.phlastname');". I get "Uncaught ReferenceError: i18n is not defined." error
What am I doing wrong? Thanks in advance.
UPDATE
I changed my code so that it works on the clientside. I included the i18n lib in my page. and updated my javascript/jquery code to this:
$.i18n.init({
debug: true
}, function(t) {
return t("app.lblname");
});
So now I don't seem to get the above mentioned error, however I am not getting text.

