LanguageParser is used to parse the HTTP
Accept-Language
header. This takes in an
Accept-Language
header and parses it according the RFC 2616 BNF for the
Accept-Language
header. This also has the ability to sequence the language tokens in terms of the most preferred and the least preferred.
This uses the qvalues outlined by RFC 2616 to order the language tokens by preference. Typically the language tokens will not have qvalues with the language. However when a language tag has the qvalue parameter then this tag will be ordered based on the value of that parameter. A language tag without the qvalue parameter is considered to have a qvalue of 1 and is ordered accordingly.
@author Niall Gallagher