jeresig/i18n-node-2 — pull request #32 by peecky (2014-04-20 08:10:16+00:00)
Title: lower case for preferred locale

The `preferredLocale()` function did not always return locale in lower case. This may conflict with using other functions together, such as `setLocaleFromQuery()` and `setLocaleFromCookie()`. So I changed it to return always lower case.

Also, I removed unnecessary loops. When my web browser sent `headers["accept-language"] == 'ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4'`, the while loop in the `preferredLocale()` function looped four times even the `ko` was matched on the first loop.