AcceptLanguage
A lightweight, thread-safe Ruby library for parsing the Accept-Language HTTP header field.
This implementation conforms to:
Note RFC 7231 obsoletes RFC 2616 (the original HTTP/1.1 specification). The Accept-Language header behavior defined in RFC 2616 Section 14.4 remains unchanged in RFC 7231, ensuring full backward compatibility.
Installation
gem "accept_language"
Usage
AcceptLanguage . parse ( "da, en-GB;q=0.8, en;q=0.7" ) . match ( :en , :da ) # => :da
Behavior
Quality values
... continue reading