I can't figure out how I should use i18n-node module inside my application.
Within views, for static texts, it's easy, it works perfectly but...
Here is my problem :
Sometimes I have to set some error messages or something else, e.g :
req.flash('message', __('Unknown user %s', login));
Then I'll have to send this message to my views, e.g :
res.render('myview', {message: req.flash('message')});
But first, my message "Unknown user %s"
will only be set in the default language json file, and then even if I put "Unknown user %s": "Something in the client language"
in the client language json file, it will still display "Unknown user myUserLogin"
.
Does someone have a good working example to share ?
Edit: And because, there is a variable in the translated string, I can't just do that :
res.render('myview', {message: __(req.flash('message'))});
because it will set "Unknown user myUserLogin"
in the client language json file, instead of "Unknown user %s"
...