0.0.2-3 • Published 11 years ago

node-i18n-mongo v0.0.2-3

Weekly downloads
4
License
-
Repository
github
Last release
11 years ago

node-i18n-mongo

Module for i18n support in node.js projects with mongodb

Build Status NPM version Build Status

NPM

Install module:

npm install node-i18n-mongo

and then use it:

var i18n = require('node-i18n-mongo');

i18n.configInit( { defaultLocale: "en_US", locale: "de_DE" } ); // <-- init config, mongo connect and global function apply

Then you'me may use it in Fiber:

i18n.Fiber(function(){
	i18n.add({
        "Welcome to my World, %s": "Willkommen in meiner Welt, %s"
    }, 'de_DE');

    i18n.i18nGetLocale();

    console.log( i18n.__dict );
    console.log( __("Welcome to my World, %s", ["Mike"]) );
});

For use it in ExpressJs:

var app = express();
...
i18n.configInit( { defaultLocale: "en_US", locale: "de_DE", express: app } );

Then use it in ejs:

<%= __("Welcome to my World, %s", [name]) %>

or in jade:

h2= title
  p= __("Welcome to my World, %s", [name])

Bitdeli Badge

0.0.2-3

11 years ago

0.0.2-2

11 years ago

0.0.2-1

11 years ago

0.0.2

11 years ago

0.0.1-1

11 years ago

0.0.1

11 years ago