Is it possible to show exception message in pt-BR?

5

I would like my exception message to be displayed in Portuguese, would anyone know how?

catch (Exception ex)
{
  Debug.Writeline(ex.Message);
}
    
asked by anonymous 07.08.2015 / 02:58

1 answer

5

Besides not good at capturing Exception I'll tell you about it at several questions here , it is best to do something useful when catching an exception. Showing the raw text of the exception for the user is often not considered very useful. In general these messages are meant to inform the programmer and not the user.

If you still want to do this, change the thread culture:

Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("pt-BR");

If Windows does not have the Portuguese packages installed, then it becomes more complicated, you would have to do it manually.

See not working in dotNetFiddle :) that does not have the package installed. But look at how to test it worked out.

    
07.08.2015 / 03:07