View previous topic :: View next topic |
Author |
Message |
rocco76
Joined: 28 Mar 2007 Posts: 11
|
Posted: Fri Sep 28, 2007 11:04 am Post subject: Localizing MessageBox strings |
|
|
Hi
I'm trying Globalizer but I can't understand how it can help me to localize strings in messagebox in my source code. Thankyou. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Sep 28, 2007 11:56 pm Post subject: |
|
|
I assume you mean localizing the text on the buttons (OK, Cancel, Yes, No etc). The text and caption can be localized easily by adding the strings to your Properties.Resources and then passing these to the MessageBox methods.
Since the button text is supplied by the system you don't have direct control over it. The proper way to handle this is to install the .NET Framework Language Pack for the languages you are using. The buttons will then display in the language you have selected as your UICulture.
This solution is not always entirely satisfactory when building a multilingual application because it forces users to download and install an additional package. Generally however if the user is using a language specific operating system this Language pack should be installed by default. An alternative solution, which can be useful in some circumstances, is to use a windows hook to intercept messages sent to the underlying system dialogs and translate the button text on the fly. We have some code that does this and will publish a Code Project article soon on the technique. You may also be interested in our Code Project article on Localizing .NET Enums. _________________ Infralution Support |
|
Back to top |
|
|
RattleSoft
Joined: 30 Mar 2007 Posts: 6 Location: Juneau, AK
|
Posted: Mon Oct 15, 2007 11:31 pm Post subject: |
|
|
Another option is to make your own messagebox control or use an existing one that can be easily modified. I think there might be one on CodeProject.
This might work the best since you won't need to install the Language Pack. _________________ Tyler J. McDowall
CEO, RattleSoft
www.RattleSoft.com |
|
Back to top |
|
|
|