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

defaultLocale overridden by first language code #90

Open k2s opened 8 years ago

k2s commented 8 years ago

configuration option defaultLocale is always overridden by first language code

var localeConfig = {
    langs: {
        'en': 'English',
        'sk': 'Slovak'
    },
    defaultLocale: 'sk'
};

i18n.expressBind(app, localeConfig);

value of req.i18n.defaultLocale will be set to en, it should be sk

SeverS commented 8 years ago

actually defaultLocale option is not working. it defaults to 'en' no matter what.

cjduncana commented 8 years ago

I just recently encountered the same problem.

gjuchault commented 8 years ago

I'll look into this when I have some time