rack/rack-contrib — pull request #60 by jamesarosen (2012-08-19 00:36:28+00:00)
Title: Some fixes & improvements to Rack::Locale

* sort the values in Accept-Languages by their qvalue
* reset `I18n.locale` to its previous setting even if the underlying app throws an exception
* return the whole locale string (e.g. `en-gb`), not just the first section
* extract some logic to a helper method