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

accept-language header overriding query parameter and other methods to set the local #94

Open Spouwny opened 8 years ago

Spouwny commented 8 years ago

Getting www.test.com?lang=en with the header accept-language="fr" will be displayed in "fr".

I don't know if this is intended, but overriding user preference seems odd to me.

It seems related to #36

gjuchault commented 8 years ago

Why would ?lang=en be a user preference ? We should think of a ranking system, but it seems weird to have a user adding himself ?lang=en in his bar. You could use cookie or another way to do that

Spouwny commented 8 years ago

The term "user preference" is poorly choosen and the way to set this preference has nothing to do with the issue.

The issue is that the result of GET http://www.test.com?lang=en may be in an other language than specified by the url.

This could be really confusing. Visible settings should have the priority on invisible ones.

gjuchault commented 8 years ago

I agree with that but I'm struggling with time :/.