I have a Strings.resx
and a Strings.nl.resx
file.
The first contains a English string, the other a Dutch string. They are part of a C# Class Library
project: Module
.
public static string testString()
{
//I Force the culture to always be english
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
return Strings.Hello;
}
When I call them from a simple Console Application
, it works:
Console.WriteLine(Module.testString()); //English string gets returned
When I do the same from my ASP.NET MVC
application, I get the Dutch version...
public ActionResult testCulture()
{
return Content(Module.testString()); //Dutch string gets returned..?!
}
I am using a Dutch Windows, so any auto-setting will be Dutch.But how can I get a different string when the culture is hardcoded to en-us in the class library??
What am i missing here?