How can I force and application and any threads that are started by that application to run under a specific culture?
I have tried the following but I still get exceptions in English. My understanding was that the wording on exceptions are translated using the active culture.
static void Main(string[] args)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES", true);
Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-ES", true);
try
{
int number = Convert.ToInt32("not a number");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.WriteLine("Press any key to continue...");
Console.ReadLine();
}
Output: Input string was not in a correct format.
shouldn't it be in Spanish?