0

I can change the language for an Umbraco Surface Controller but I cannot see how to change it for an Umbraco API controller.

Even though I can change the culture in my global.ascx BeginRequest the Model is still trying to bind a date using en-US rather than en-UK.

I have also tried custom model binding but that does not seem to fire at all.

Marko Jovanov
  • 418
  • 10
  • 25
RadarBug
  • 707
  • 1
  • 6
  • 13

1 Answers1

1

Have you tried setting the CurrentUICulture, in you API Controller? Like this:

System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

I had a similar issue when trying to retrieve Umbraco.Context in regular Umbraco Controller.

Community
  • 1
  • 1
Marko Jovanov
  • 418
  • 10
  • 25