How to show the message box (.net 2.0) in culture specific?

  • Thread starter Thread starter Gangadhar Kotu
  • Start date Start date
G

Gangadhar Kotu

Hi,

Here are the things we have already tested.

Installed WinXP MUI pack also, but still showing the text in English
only.

Could you please help me in this regards to get the text of MessageBox
in other locale.

Regards
Gangadhar Kotu
 
Hi,

To be precise, the button text in the message box should come in
culture specific.

Regards
Gangadhar Kotu
 
To be precise, the button text in the message box should come in
culture specific.

Then you just need to use a ResourceManager and fetch the appropriate
text before you call MessageBox.Show.

Jon
 
Then you just need to use a ResourceManager and fetch the appropriate
text before you call MessageBox.Show.

Jon

Hi,

No. Not the text in the Message Box. But only the OK, Cancel, Yes,
No... buttons text to be culture specific........

- Gangadhar Kotu
 
No. Not the text in the Message Box. But only the OK, Cancel, Yes,
No... buttons text to be culture specific........

Ah, I see. Hmm... not sure on that one - a quick test didn't show any
change for OK/Cancel when changing the current thread's culture. It
could be that changing the culture of Windows will do it though.
 
Ah, I see. Hmm... not sure on that one - a quick test didn't show any
change for OK/Cancel when changing the current thread's culture. It
could be that changing the culture of Windows will do it though.

Hi,

For the buttons on the MessageBox, the developer doesn't have access
as they enums.

MessageBoxButtons.OKCancel
MessageBoxButtons.YesNo
MessageBoxButtons.YesNoCancel

If you see the above enums, you can only specify on the above Enum but
not the culture specific..

- Gangadhar Kotu
 
For the buttons on the MessageBox, the developer doesn't have access
as they enums.

MessageBoxButtons.OKCancel
MessageBoxButtons.YesNo
MessageBoxButtons.YesNoCancel

If you see the above enums, you can only specify on the above Enum but
not the culture specific..

My point is that if you have Windows in a particular culture, I'd
*hope* that the buttons produced by the above enum will be localized.

Jon
 
My point is that if you have Windows in a particular culture, I'd
*hope* that the buttons produced by the above enum will be localized.

Setting the thread CurrentUICulture does not change the common dialog
language. To change the language used for common dialogs you have to
set the "Language used in menus and dialogs" option in the system
Regional and Language Options dialog. Unfortunately this also
requires logging off and on again before it takes affect.

This is a bit of a pain because while you can swap language for most
of your .NET application simply by changing the thread
CurrentUICulture it can leave your application in a half translated
state if you use common dialogs. It is possible to translate the
button strings in MessageBoxes (and other common dialogs such as
FileOpen, PrintSetup etc) using windows hooks. There are some
articles on CodeProject on this topic.

Regard
Grant Frisken
Infralution
..NET Localization Tools
www.infralution.com/globalizer.html
 
Back
Top