jeresig / i18n-node-2

Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates.
MIT License
507 stars 79 forks source link

Expess code from readme not working ... #28

Closed ghost closed 10 years ago

ghost commented 10 years ago

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 ?

ghost commented 10 years ago

Anybody there ?

Need help on this quick :( ...

jeresig commented 10 years ago

I think I just fixed this via a landed pull request.