Merge pull request #1118 from umbraco/temp-U4-7950
Use CultureInfo.CurrentCulture if UmbracoContext.PublishedContentRequ…
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
@@ -147,8 +148,10 @@ namespace Umbraco.Web.Mvc
|
|||||||
// map the view data (may change its type, may set model to null)
|
// map the view data (may change its type, may set model to null)
|
||||||
viewData = MapViewDataDictionary(viewData, typeof (TModel));
|
viewData = MapViewDataDictionary(viewData, typeof (TModel));
|
||||||
|
|
||||||
// bind the model (use context culture as default)
|
var culture = CultureInfo.CurrentCulture;
|
||||||
var culture = UmbracoContext.PublishedContentRequest.Culture;
|
// bind the model (use context culture as default, if available)
|
||||||
|
if (UmbracoContext.PublishedContentRequest != null && UmbracoContext.PublishedContentRequest.Culture != null)
|
||||||
|
culture = UmbracoContext.PublishedContentRequest.Culture;
|
||||||
viewData.Model = RenderModelBinder.BindModel(viewDataModel, typeof (TModel), culture);
|
viewData.Model = RenderModelBinder.BindModel(viewDataModel, typeof (TModel), culture);
|
||||||
|
|
||||||
// set the view data
|
// set the view data
|
||||||
|
|||||||
Reference in New Issue
Block a user