2

(how) is it possible to display standard .NET exception messages like the SocketException "Network is unreachable" in another language?

I thougth it depends on the CurrentCulture but in my App (Android & iOS) the message is always in English even though my CurrentCulture says "de-DE".

Background is that i want to display some exception messages in dialogs.

Hint: I am using native Xamarin and not Forms.

Kind regards

Oliver

dragondx
  • 96
  • 5

1 Answers1

1

In .Net Desktop or Web App in general we use a simple set like this :

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");

But don't sure if this is a good practice with Xamarin

  • This is how you do it in Xamarin too to make the .Net part of the world load the right language – Jon G Stødle Jul 17 '17 at 10:23
  • I guess the mentioned SocketException Messages are not localized in Xamarin/Mono which is why setting UICulture has no effect. See here [link](https://github.com/mono/mono/blob/91288cad6a6c093ee1ca9b072219144c8bac9f75/mcs/class/System/ReferenceSources/Win32Exception.cs) – dragondx Oct 17 '17 at 14:28