NancyFx/Nancy — pull request #857 by jchannon (2012-12-10 11:05:30+00:00)
Title: Added culture to Nancy context

Nancy needs some internationalisation love so the first attempt is to add CultureInfo to the NancyContext.

The culture on the context gets set by ICultureService.DetermineCurrentCulture

I have added DefaultCultureService to NancyInternalConfiguration so this can be overridden.

The DefaultCultureService reads the Form, Path, Session, Cookies to determine the current culture. If none are populated then it takes it from the Thread.CurrentThread.CurrentCulture which comes from web.config ``

Obviously different implementations of ICultureService may choose to decide upon current culture in another manner.

Localisation can then use ICultureService to determine current culture to return the expected localised key.