UnionOfRAD/lithium — pull request #375 by mariano (2012-03-11 22:43:53+00:00)
Title: Improving Locale::lookup() so it better detects alternative locales

This fix improves locale negotiation by optimizing the `Locale::lookup()` code so horizontal matching is better treated. This means that if the locale to search is `es_ES` against available locales `es_AR`, `en_US`, `en`, without this pull request the best match would simply be `en`. With this pull request, it correctly returns `es_AR`.

Check the `testLookup()` and `testPreferredAvailableNegotiation()` tests for more examples.