I am doing the following but this is not working for me.
At the top of my app.js, I have:
i18n = require('i18n-2');
In my app.configure method, I have at the end:
// multilanguage support
i18n.expressBind(app, {
// setup some locales - other locales default to en silently
locales: ['en', 'de'],
defaultLocale: 'en'
});
I have created a folder at the root where app.js is, named 'locales' and have a en.js file there with simply:
{
"Hello": "I am Hello in English"
}
i18n.("Hello") does not work anywhere in the app whereas in the request req.i18n.("Hello") does not work either.
The error I keep getting says something like "has not method __"
Hi,
I am doing the following but this is not working for me.
At the top of my app.js, I have:
i18n = require('i18n-2');
In my app.configure method, I have at the end:
// multilanguage support i18n.expressBind(app, { // setup some locales - other locales default to en silently locales: ['en', 'de'], defaultLocale: 'en' });
I have created a folder at the root where app.js is, named 'locales' and have a en.js file there with simply:
{ "Hello": "I am Hello in English" }
i18n.("Hello") does not work anywhere in the app whereas in the request req.i18n.("Hello") does not work either.
The error I keep getting says something like "has not method __"
Can you help ?