Overview

Sprechen?

From the movie Madagascar (If you've got kids you'll understand...)

You, quadruped. Sprechen Sie English?

I sprechen.

Example Usage

Load messages from the messages folder for the default locale -currently en_US, might arrogantly change this to en_AU ;)

var sprechen = require('sprechen'),
    messages = sprechen('messages');

console.log(messages.hello);
> hello

Or, load messages for a specific locale:

var sprechen = require('sprechen'),
    messages = sprechen('messages', 'en_AU');

console.log(messages.hello);
> G'day

Example Usage (Async)

Being a Node library, it would be a little rude if sprechen didn't support async operation. Output as per the examples above.

Default locale:

var sprechen = require('sprechen');

sprechen('messages', function(messages) {
    console.log(messages.hello);    
});

Specific locale:

var sprechen = require('sprechen');

sprechen('messages', 'en_AU', function(messages) {
    console.log(messages.hello);    
});