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

Access to the i18n outside of a request #128

Open sganz opened 4 years ago

sganz commented 4 years ago

Quick question on how the best way to use i18n.__() functionality outside of a request. I have got things working inside of express by following your examples, and all good.

So the question is if I need to use the i18n.__() functionality outside of an express request (where I have no 'req' object) what is the best practice? Just create another i18n instance, or get the existing one from somewhere (app? express?) .

Thanks Sandy