How to implement multi-language in node.js for template and routers with i18 How can I use i18n in other functions to the language change. i18n only generates empty files en.js es.js ... this is so or is wrong?
Example
//app.js
require(i18n):
require("./router" );
//router.js
export.example = function (){
.
.
.
req.session.error = __('You have error: %s', error);
}
500 TypeError: Object # has no method '__'
use the app with i18n internationalization, it is best used only in the final template with this is easier to edit for other languages and not have to search the texts throughout our code.
Use jade for internationalization as follows
#{__('Hello')}
I followed the other information as the reference says.