mashpie/i18n-node — pull request #23 by leods92 (2012-05-27 11:58:06+00:00)
Title: Made some improvements regarding query-string parameter and cookie

Here's a summary:

* Removed overrideLocaleFromQuery(), added to config options "query_param" and added to guessLanguage() query-string parameter detection (only if config "query_param" is set).
Comment: That way we don't have to call a method in case we want to detect locale from URL, which is pretty common. Just set the config parameter and we're good to go.

* Moved cookie detection in guessLanguage() to avoid useless detection from Accept-Language HTTP header.
Comment: If we have a cookie, why bother detecting the HTTP header?

* Made init() send the language cookie after guessing the language (only if config cookiename is set and CookieParser middleware is available).
Comment: if a cookie is set, the i18n already reads it to fetch the language. Instead of sending the cookie somewhere else in the app, i18n.init() now does it automatically which is pretty nice.

* Changed version to 0.3.5 as changes were significant.