1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
Commit graph

6 commits

Author SHA1 Message Date
Johan Lundström
3b96430046 Improve parsing of HTTP_ACCEPT_LANGUAGE (continue Nate's work) (#3449)
* Add test case for sv locale

* Use Rack::Utils to parse locale header

* Take "q" value into account

* Make '*' match the default locale.

* Add test for available_locales

* Correct test case sv -> en

* Add missing test cases for Safari requests

* Add missing require needed to run a single test file

* Reimplement WebHelpers#locale to handle regions in header

Implementation inspired by:

https://github.com/iain/http_accept_language/blob/master/lib/http_accept_language/parser.rb

Also see:

https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4

* Add docs and references

* Add failing test cases for pt-br, pt-pt, pt (examples taken from Chrome & Safari)

* Add more test cases for Mac + Chrome + UK English + US English

* Make test cases for 'pt-PT,pt;q=0.8,en-US;q=0.6,en;q=0.4' and 'pt-pt' pass

* Make special case 'ru,en' work (equal qvalues)
2017-05-01 10:47:51 -07:00
Mike Perham
2c9f7662fc Freeze all string literals in source, fixes #2741
Tests pass and smoke test works perfectly.
2015-12-31 15:33:35 -08:00
Theodor Tonum
56131145d8 Fix Norwegian Bokmål (nb) locale 2015-10-04 20:47:41 +02:00
Mike Perham
53e6b9e2df Test suite overhaul
Remove Redis mocking.  Minimize Redis flushing where possible.
2015-09-23 10:56:37 -07:00
Mike Perham
5e1379087c Further tweaks for locale determination, fixes #2353 2015-05-15 12:02:57 -07:00
Mike Perham
3288aee6c3 Update web locale determination, fixes #2243
The code worked with "fr,en" but did not work with "fr-FR,fr,en"
2015-04-09 11:14:05 -07:00