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

Safe HaskellNone
LanguageHaskell98

Happstack.Server.I18N

Synopsis

Documentation

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.