Discussion:
Localized Exception Message
(too old to reply)
Luthgers, John
2008-08-15 14:13:53 UTC
Permalink
Hi,

my application uses a global exception handler to catch any unhandled
exceptions and then shows a dialog to inform the user. The dialog shows the
exception content and gives the ability to send an error report to my
website. Now i noticed, that the exception text of system exceptions can by
localized by installing the dotnet language packs. The result is, that some
users send a japanese exception to the website.

My goal is:
1) show the user the localized exception message within the dialog
2) send the exception in english to the website, so i can read it later :)

Goal 1 is already accomplished. And I know that i can change the culture via
"Thread.CurrentThread.CurrentUICulture" to english, but that works only if
the culture is set before the exception is thrown and doing so avoid the
abillity to show a localized version of the message to the user.

Is there any way to "reinit" the text of an exception based on the current
culture?

-J-
Alvin Bruney [ASP.NET MVP]
2008-08-16 02:17:06 UTC
Permalink
Not sure there is much you can do about this situation given your
circumstance. Have a look at this thread
http://forums.msdn.microsoft.com/en-US/clr/thread/f9fd99d7-4411-4cd9-a126-676068856bf5/
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
Hi,
my application uses a global exception handler to catch any unhandled
exceptions and then shows a dialog to inform the user. The dialog shows
the exception content and gives the ability to send an error report to my
website. Now i noticed, that the exception text of system exceptions can
by localized by installing the dotnet language packs. The result is, that
some users send a japanese exception to the website.
1) show the user the localized exception message within the dialog
2) send the exception in english to the website, so i can read it later :)
Goal 1 is already accomplished. And I know that i can change the culture
via "Thread.CurrentThread.CurrentUICulture" to english, but that works
only if the culture is set before the exception is thrown and doing so
avoid the abillity to show a localized version of the message to the user.
Is there any way to "reinit" the text of an exception based on the current
culture?
-J-
Luthgers, John
2008-08-16 06:13:55 UTC
Permalink
So, there seems to be no way. Thank you.

-J-
Alvin Bruney [ASP.NET MVP]
2008-08-16 22:39:41 UTC
Permalink
Well, there is but it doesn't jive with your approach. Your application runs
on the server, you should not be localizing exceptions on the server since
the support personnel is expected to see the message in their local. What
you should do is translate the message that will be sent to the client in
the requesting locale. That way, german folk see german messages but support
personal in England see English exception messages. I'd argue here that
clients should never see an exception if it wasn't sanitized in some way.
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
So, there seems to be no way. Thank you.
-J-
Luthgers, John
2008-08-16 23:42:17 UTC
Permalink
You misunderstood something i havnt pointed out very well. The application
is a winforms application, not a ASP.NET page. I thought it isnt that
important and correctly addressed in a dotnet.framework group. But of course
it was my fault. So, there is no client/server side. The exception is thrown
anywhere in my application and before it crashes it is caught by a global
exception handler. Now a dialog comes up, which shows some error details to
the user (for the case the user can eliminate the problem himself; and this
text should be localized) and gives him the ability to send the exception
content (just plain text; but that should be in english localization) to my
webserver (for later error analysis). The problematic exceptions are system
exceptions like "ArgumentException" or "ArgumentNullException", because they
are automatically localized based on the threads UI-culture.

The link you posted was exactly related to my topic. It was not related to
ASP.NET. The conclusion of this thread is that you should uninstall the
language pack. But the users of this application are spread all over the
world and i'm quite sure they will not uninstall their language pack only
for giving me the english exception text without any benefit for themself.

Till now, i dont know how to get different localized exception texts from a
single exception. And there seems to be no solution.

Thanks so far.
-J-
Alvin Bruney [ASP.NET MVP]
2008-08-17 03:28:22 UTC
Permalink
Ok, makes sense. I do not have a solution for you.
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
You misunderstood something i havnt pointed out very well. The application
is a winforms application, not a ASP.NET page. I thought it isnt that
important and correctly addressed in a dotnet.framework group. But of
course it was my fault. So, there is no client/server side. The exception
is thrown anywhere in my application and before it crashes it is caught by
a global exception handler. Now a dialog comes up, which shows some error
details to the user (for the case the user can eliminate the problem
himself; and this text should be localized) and gives him the ability to
send the exception content (just plain text; but that should be in english
localization) to my webserver (for later error analysis). The problematic
exceptions are system exceptions like "ArgumentException" or
"ArgumentNullException", because they are automatically localized based on
the threads UI-culture.
The link you posted was exactly related to my topic. It was not related to
ASP.NET. The conclusion of this thread is that you should uninstall the
language pack. But the users of this application are spread all over the
world and i'm quite sure they will not uninstall their language pack only
for giving me the english exception text without any benefit for themself.
Till now, i dont know how to get different localized exception texts from
a single exception. And there seems to be no solution.
Thanks so far.
-J-
Jaroslav Bucek
2011-07-06 22:32:39 UTC
Permalink
Use www.unlocalize.com project to find out the original (English) text of that exception.
Post by Luthgers, John
Hi,
my application uses a global exception handler to catch any unhandled
exceptions and then shows a dialog to inform the user. The dialog shows the
exception content and gives the ability to send an error report to my
website. Now i noticed, that the exception text of system exceptions can by
localized by installing the dotnet language packs. The result is, that some
users send a japanese exception to the website.
1) show the user the localized exception message within the dialog
2) send the exception in english to the website, so i can read it later :)
Goal 1 is already accomplished. And I know that i can change the culture via
"Thread.CurrentThread.CurrentUICulture" to english, but that works only if
the culture is set before the exception is thrown and doing so avoid the
abillity to show a localized version of the message to the user.
Is there any way to "reinit" the text of an exception based on the current
culture?
-J-
Post by Alvin Bruney [ASP.NET MVP]
Not sure there is much you can do about this situation given your
circumstance. Have a look at this thread
http://forums.msdn.microsoft.com/en-US/clr/thread/f9fd99d7-4411-4cd9-a126-676068856bf5/
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
So, there seems to be no way. Thank you.
-J-
Post by Alvin Bruney [ASP.NET MVP]
Well, there is but it doesn't jive with your approach. Your application runs
on the server, you should not be localizing exceptions on the server since
the support personnel is expected to see the message in their local. What
you should do is translate the message that will be sent to the client in
the requesting locale. That way, german folk see german messages but support
personal in England see English exception messages. I'd argue here that
clients should never see an exception if it wasn't sanitized in some way.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
You misunderstood something i havnt pointed out very well. The application
is a winforms application, not a ASP.NET page. I thought it isnt that
important and correctly addressed in a dotnet.framework group. But of course
it was my fault. So, there is no client/server side. The exception is thrown
anywhere in my application and before it crashes it is caught by a global
exception handler. Now a dialog comes up, which shows some error details to
the user (for the case the user can eliminate the problem himself; and this
text should be localized) and gives him the ability to send the exception
content (just plain text; but that should be in english localization) to my
webserver (for later error analysis). The problematic exceptions are system
exceptions like "ArgumentException" or "ArgumentNullException", because they
are automatically localized based on the threads UI-culture.
The link you posted was exactly related to my topic. It was not related to
ASP.NET. The conclusion of this thread is that you should uninstall the
language pack. But the users of this application are spread all over the
world and i'm quite sure they will not uninstall their language pack only
for giving me the english exception text without any benefit for themself.
Till now, i dont know how to get different localized exception texts from a
single exception. And there seems to be no solution.
Thanks so far.
-J-
Post by Alvin Bruney [ASP.NET MVP]
Ok, makes sense. I do not have a solution for you.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Jaroslav Bucek
2011-07-06 22:34:45 UTC
Permalink
Use www.unlocalize.com project to find out the original (English) text of that exception.
Post by Luthgers, John
Hi,
my application uses a global exception handler to catch any unhandled
exceptions and then shows a dialog to inform the user. The dialog shows the
exception content and gives the ability to send an error report to my
website. Now i noticed, that the exception text of system exceptions can by
localized by installing the dotnet language packs. The result is, that some
users send a japanese exception to the website.
1) show the user the localized exception message within the dialog
2) send the exception in english to the website, so i can read it later :)
Goal 1 is already accomplished. And I know that i can change the culture via
"Thread.CurrentThread.CurrentUICulture" to english, but that works only if
the culture is set before the exception is thrown and doing so avoid the
abillity to show a localized version of the message to the user.
Is there any way to "reinit" the text of an exception based on the current
culture?
-J-
Post by Alvin Bruney [ASP.NET MVP]
Not sure there is much you can do about this situation given your
circumstance. Have a look at this thread
http://forums.msdn.microsoft.com/en-US/clr/thread/f9fd99d7-4411-4cd9-a126-676068856bf5/
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
So, there seems to be no way. Thank you.
-J-
Post by Alvin Bruney [ASP.NET MVP]
Well, there is but it doesn't jive with your approach. Your application runs
on the server, you should not be localizing exceptions on the server since
the support personnel is expected to see the message in their local. What
you should do is translate the message that will be sent to the client in
the requesting locale. That way, german folk see german messages but support
personal in England see English exception messages. I'd argue here that
clients should never see an exception if it wasn't sanitized in some way.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
You misunderstood something i havnt pointed out very well. The application
is a winforms application, not a ASP.NET page. I thought it isnt that
important and correctly addressed in a dotnet.framework group. But of course
it was my fault. So, there is no client/server side. The exception is thrown
anywhere in my application and before it crashes it is caught by a global
exception handler. Now a dialog comes up, which shows some error details to
the user (for the case the user can eliminate the problem himself; and this
text should be localized) and gives him the ability to send the exception
content (just plain text; but that should be in english localization) to my
webserver (for later error analysis). The problematic exceptions are system
exceptions like "ArgumentException" or "ArgumentNullException", because they
are automatically localized based on the threads UI-culture.
The link you posted was exactly related to my topic. It was not related to
ASP.NET. The conclusion of this thread is that you should uninstall the
language pack. But the users of this application are spread all over the
world and i'm quite sure they will not uninstall their language pack only
for giving me the english exception text without any benefit for themself.
Till now, i dont know how to get different localized exception texts from a
single exception. And there seems to be no solution.
Thanks so far.
-J-
Post by Alvin Bruney [ASP.NET MVP]
Ok, makes sense. I do not have a solution for you.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Jaroslav Bucek
Use www.unlocalize.com project to find out the original (English) text of that exception.
Jaroslav Bucek
2011-07-06 22:35:03 UTC
Permalink
Use www.unlocalize.com project to find out the original (English) text of that exception.
Post by Luthgers, John
Hi,
my application uses a global exception handler to catch any unhandled
exceptions and then shows a dialog to inform the user. The dialog shows the
exception content and gives the ability to send an error report to my
website. Now i noticed, that the exception text of system exceptions can by
localized by installing the dotnet language packs. The result is, that some
users send a japanese exception to the website.
1) show the user the localized exception message within the dialog
2) send the exception in english to the website, so i can read it later :)
Goal 1 is already accomplished. And I know that i can change the culture via
"Thread.CurrentThread.CurrentUICulture" to english, but that works only if
the culture is set before the exception is thrown and doing so avoid the
abillity to show a localized version of the message to the user.
Is there any way to "reinit" the text of an exception based on the current
culture?
-J-
Post by Alvin Bruney [ASP.NET MVP]
Not sure there is much you can do about this situation given your
circumstance. Have a look at this thread
http://forums.msdn.microsoft.com/en-US/clr/thread/f9fd99d7-4411-4cd9-a126-676068856bf5/
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
So, there seems to be no way. Thank you.
-J-
Post by Alvin Bruney [ASP.NET MVP]
Well, there is but it doesn't jive with your approach. Your application runs
on the server, you should not be localizing exceptions on the server since
the support personnel is expected to see the message in their local. What
you should do is translate the message that will be sent to the client in
the requesting locale. That way, german folk see german messages but support
personal in England see English exception messages. I'd argue here that
clients should never see an exception if it wasn't sanitized in some way.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Luthgers, John
You misunderstood something i havnt pointed out very well. The application
is a winforms application, not a ASP.NET page. I thought it isnt that
important and correctly addressed in a dotnet.framework group. But of course
it was my fault. So, there is no client/server side. The exception is thrown
anywhere in my application and before it crashes it is caught by a global
exception handler. Now a dialog comes up, which shows some error details to
the user (for the case the user can eliminate the problem himself; and this
text should be localized) and gives him the ability to send the exception
content (just plain text; but that should be in english localization) to my
webserver (for later error analysis). The problematic exceptions are system
exceptions like "ArgumentException" or "ArgumentNullException", because they
are automatically localized based on the threads UI-culture.
The link you posted was exactly related to my topic. It was not related to
ASP.NET. The conclusion of this thread is that you should uninstall the
language pack. But the users of this application are spread all over the
world and i'm quite sure they will not uninstall their language pack only
for giving me the english exception text without any benefit for themself.
Till now, i dont know how to get different localized exception texts from a
single exception. And there seems to be no solution.
Thanks so far.
-J-
Post by Alvin Bruney [ASP.NET MVP]
Ok, makes sense. I do not have a solution for you.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
Post by Jaroslav Bucek
Use www.unlocalize.com project to find out the original (English) text of that exception.
Post by Jaroslav Bucek
Use www.unlocalize.com project to find out the original (English) text of that exception.
Jaroslav Bucek
2011-07-06 22:37:27 UTC
Permalink
...sorry for several posts of the same message, but I've had some problems with logging...
Loading...