[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Re: Localized Exception Message

Jaroslav Bucek

7/6/2011 11:32:00 PM

Use www.unlocalize.com project to find out the original (English) text of that exception.

> On Friday, August 15, 2008 10:13 AM Luthgers, John wrote:

> 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-


>> On Friday, August 15, 2008 10:17 PM Alvin Bruney [ASP.NET MVP] wrote:

>> 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-676...
>>
>> --
>>
>> 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/De...
>> -------------------------------------------------------
>>
>>
>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>> news:uYy9mEu$IHA.1016@TK2MSFTNGP03.phx.gbl...


>>> On Saturday, August 16, 2008 2:13 AM Luthgers, John wrote:

>>> So, there seems to be no way. Thank you.
>>>
>>> -J-


>>>> On Saturday, August 16, 2008 6:39 PM Alvin Bruney [ASP.NET MVP] wrote:

>>>> 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/De...
>>>> -------------------------------------------------------
>>>>
>>>>
>>>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>>>> news:#MqMGd2$IHA.4816@TK2MSFTNGP06.phx.gbl...


>>>>> On Saturday, August 16, 2008 7:42 PM Luthgers, John wrote:

>>>>> 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-


>>>>>> On Saturday, August 16, 2008 11:28 PM Alvin Bruney [ASP.NET MVP] wrote:

>>>>>> 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/De...
>>>>>> -------------------------------------------------------
>>>>>>
>>>>>>
>>>>>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>>>>>> news:e5CO8m$$IHA.5192@TK2MSFTNGP04.phx.gbl...



2 Answers

Jaroslav Bucek

7/6/2011 11:34:00 PM

0

Use www.unlocalize.com project to find out the original (English) text of that exception.

> On Friday, August 15, 2008 10:13 AM Luthgers, John wrote:

> 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-


>> On Friday, August 15, 2008 10:17 PM Alvin Bruney [ASP.NET MVP] wrote:

>> 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-676...
>>
>> --
>>
>> 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/De...
>> -------------------------------------------------------
>>
>>
>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>> news:uYy9mEu$IHA.1016@TK2MSFTNGP03.phx.gbl...


>>> On Saturday, August 16, 2008 2:13 AM Luthgers, John wrote:

>>> So, there seems to be no way. Thank you.
>>>
>>> -J-


>>>> On Saturday, August 16, 2008 6:39 PM Alvin Bruney [ASP.NET MVP] wrote:

>>>> 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/De...
>>>> -------------------------------------------------------
>>>>
>>>>
>>>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>>>> news:#MqMGd2$IHA.4816@TK2MSFTNGP06.phx.gbl...


>>>>> On Saturday, August 16, 2008 7:42 PM Luthgers, John wrote:

>>>>> 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-


>>>>>> On Saturday, August 16, 2008 11:28 PM Alvin Bruney [ASP.NET MVP] wrote:

>>>>>> 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/De...
>>>>>> -------------------------------------------------------
>>>>>>
>>>>>>
>>>>>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>>>>>> news:e5CO8m$$IHA.5192@TK2MSFTNGP04.phx.gbl...


>>>>>>> On Wednesday, July 06, 2011 6:31 PM Jaroslav Bucek wrote:

>>>>>>> Use www.unlocalize.com project to find out the original (English) text of that exception.



Jaroslav Bucek

7/6/2011 11:35:00 PM

0

Use www.unlocalize.com project to find out the original (English) text of that exception.

> On Friday, August 15, 2008 10:13 AM Luthgers, John wrote:

> 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-


>> On Friday, August 15, 2008 10:17 PM Alvin Bruney [ASP.NET MVP] wrote:

>> 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-676...
>>
>> --
>>
>> 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/De...
>> -------------------------------------------------------
>>
>>
>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>> news:uYy9mEu$IHA.1016@TK2MSFTNGP03.phx.gbl...


>>> On Saturday, August 16, 2008 2:13 AM Luthgers, John wrote:

>>> So, there seems to be no way. Thank you.
>>>
>>> -J-


>>>> On Saturday, August 16, 2008 6:39 PM Alvin Bruney [ASP.NET MVP] wrote:

>>>> 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/De...
>>>> -------------------------------------------------------
>>>>
>>>>
>>>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>>>> news:#MqMGd2$IHA.4816@TK2MSFTNGP06.phx.gbl...


>>>>> On Saturday, August 16, 2008 7:42 PM Luthgers, John wrote:

>>>>> 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-


>>>>>> On Saturday, August 16, 2008 11:28 PM Alvin Bruney [ASP.NET MVP] wrote:

>>>>>> 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/De...
>>>>>> -------------------------------------------------------
>>>>>>
>>>>>>
>>>>>> "Luthgers, John" <jls17@gmx.net.nospam> wrote in message
>>>>>> news:e5CO8m$$IHA.5192@TK2MSFTNGP04.phx.gbl...


>>>>>>> On Wednesday, July 06, 2011 6:31 PM Jaroslav Bucek wrote:

>>>>>>> Use www.unlocalize.com project to find out the original (English) text of that exception.


>>>>>>>> On Wednesday, July 06, 2011 6:34 PM Jaroslav Bucek wrote:

>>>>>>>> Use www.unlocalize.com project to find out the original (English) text of that exception.