happstack-server-7.1.5: Web related tools and services.

Safe HaskellNone




acceptLanguage :: Happstack m => m [(Text, Maybe Double)]Source

parse the 'Accept-Language' header, or [] if not found.

bestLanguage :: [(Text, Maybe Double)] -> [Text]Source

deconstruct the acceptLanguage results a return a list of languages sorted by preference in descending order.

Note: this implementation does not conform to RFC4647

Among other things, it does not handle wildcards. A proper implementation needs to take a list of available languages.