all groups > dotnet internationalization > october 2004 >
You're in the

dotnet internationalization

group:

MessageBox and Internationalization


MessageBox and Internationalization John Bowman
10/27/2004 9:38:51 AM
dotnet internationalization:
Hi,

I've got a very simple WinForms C# app that the form's Localizable property
is set to true. When you press a button it merely calls
MessageBox.Show("Hello World!"). I now have a dedicated test system
installed w/ German Win2K and the redistributable .NET 1.1 framework
(supposedly in German from the MS web site). When I run this app, the
MessageBox button labels still say "OK" and "Cancel", why are they not in
German? What must I do to effect such behavior? Since MessageBox is a
System.Windows.Forms object, I have no control over it's button labels, only
the message and the title passed in.

TIA,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> john.bowman@thermo.com

Re: MessageBox and Internationalization Michael \(michka\) Kaplan [MS]
10/27/2004 11:09:22 AM
This call is a wrapper around the message boxx provided by the operating
system, so only a German OS would be expected to show German strings....


--
MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.


"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:OQdguKDvEHA.1296@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization John Bowman
10/27/2004 3:35:27 PM
Micheal,

Yes I know that. I'm running it on truly German Windows, but the buttons on
the MessageBox still shown in English. How do you fix that?

John

"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> wrote in
message news:u9vn3$EvEHA.2016@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization Michael \(michka\) Kaplan [MS]
10/27/2004 4:25:25 PM
Do you have more than one UI language on the system? If so then you must
have the properly set UICulture to see the appropriate results....


--
MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.


"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:e4uh$RGvEHA.3624@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization John Bowman
10/28/2004 6:32:08 AM
This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C4BCB7.D96F8CE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Michael,

The System is running true German windows, as this is what was =
installed... NOT English windows w/ changed regional settings. The code =
does nothing special. Here's the 1 line of code in the Button1_Click =
event handler that puts up the MessageBox:

MessageBox.Show(Thread.CurrentThread.CurrentUICulture.Name + "\n" + =
Thread.CurrentThread.CurrentCulture.Name);

When this MessageBox appears, the OK button says: OK, instead of the =
German equivalent and the message itself indicates "de-DE" and "de-DE" =
respectively so the program's thread's UI culture is correct.

John


"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> wrote in =
message news:u8DYewHvEHA.1988@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]
------=_NextPart_000_0007_01C4BCB7.D96F8CE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Michael,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The System is running true German =
windows, as this=20
is what was installed... NOT English windows w/ changed regional =
settings. The=20
code does nothing special. Here's the 1 line of code in the =
Button1_Click event=20
handler that puts up the MessageBox:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<P><FONT face=3DArial=20
size=3D2>MessageBox.Show(Thread.CurrentThread.CurrentUICulture.Name + =
"\n" +=20
</FONT><FONT face=3DArial=20
size=3D2>Thread.CurrentThread.CurrentCulture.Name);</FONT></P>
<P><FONT face=3DArial size=3D2>When this MessageBox appears, the OK =
button says:=20
OK,&nbsp;instead of&nbsp;the German equivalent and the message itself =
indicates=20
"de-DE" and "de-DE" respectively so the program's thread's UI culture is =

correct.</FONT></P>
<P><FONT face=3DArial size=3D2>John</FONT></P></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Michael (michka) Kaplan [MS]" =
&lt;</FONT><A=20
href=3D"mailto:michkap@online.microsoft.com"><FONT face=3DArial=20
size=3D2>michkap@online.microsoft.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote=20
in message </FONT><A =
href=3D"news:u8DYewHvEHA.1988@TK2MSFTNGP12.phx.gbl"><FONT=20
face=3DArial =
size=3D2>news:u8DYewHvEHA.1988@TK2MSFTNGP12.phx.gbl</FONT></A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; =
Do you have more=20
than one UI language on the system? If so then you must<BR>&gt; have the =

properly set UICulture to see the appropriate results....<BR>&gt; =
<BR>&gt;=20
<BR>&gt; -- <BR>&gt; MichKa [MS]<BR>&gt; NLS Collation/Locale/Keyboard =
Technical=20
Lead<BR>&gt; Globalization Infrastructure and Font Technologies<BR>&gt; =
Windows=20
International Division<BR>&gt; <BR>&gt; This posting is provided "AS IS" =

with<BR>&gt; no warranties, and confers no rights.<BR>&gt; <BR>&gt; =
<BR>&gt;=20
"John Bowman </FONT><A href=3D"mailto:john.bowman@thermo.com"><FONT =
face=3DArial=20
size=3D2>john.bowman@thermo.com</FONT></A><FONT face=3DArial =
size=3D2>&gt;"=20
&lt;&lt;Remove this before reply&gt; wrote in<BR>&gt; message </FONT><A=20
href=3D"news:e4uh$RGvEHA.3624@TK2MSFTNGP09.phx.gbl"><FONT face=3DArial=20
size=3D2>news:e4uh$RGvEHA.3624@TK2MSFTNGP09.phx.gbl</FONT></A><FONT =
face=3DArial=20
size=3D2>...<BR>&gt;&gt; Micheal,<BR>&gt;&gt;<BR>&gt;&gt; Yes I know =
that. I'm=20
running it on truly German Windows, but the buttons<BR>&gt; =
on<BR>&gt;&gt; the=20
MessageBox still shown in English. How do you fix =
that?<BR>&gt;&gt;<BR>&gt;&gt;=20
John<BR>&gt;&gt;<BR>&gt;&gt; "Michael (michka) Kaplan [MS]" =
&lt;</FONT><A=20
href=3D"mailto:michkap@online.microsoft.com"><FONT face=3DArial=20
size=3D2>michkap@online.microsoft.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote=20
in<BR>&gt;&gt; message </FONT><A=20
href=3D"news:u9vn3$EvEHA.2016@TK2MSFTNGP15.phx.gbl"><FONT face=3DArial=20
size=3D2>news:u9vn3$EvEHA.2016@TK2MSFTNGP15.phx.gbl</FONT></A><FONT =
face=3DArial=20
Re: MessageBox and Internationalization Michael \(michka\) Kaplan [MS]
10/31/2004 3:06:14 PM
Ok, I am very confused now.

You have German Windows and German .NET framework, yet you are still getting
English strings?


--
MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.



"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:#mcwDHOvEHA.2172@TK2MSFTNGP14.phx.gbl...
Michael,

The System is running true German windows, as this is what was installed...
NOT English windows w/ changed regional settings. The code does nothing
special. Here's the 1 line of code in the Button1_Click event handler that
puts up the MessageBox:

MessageBox.Show(Thread.CurrentThread.CurrentUICulture.Name + "\n" +
Thread.CurrentThread.CurrentCulture.Name);

When this MessageBox appears, the OK button says: OK, instead of the German
equivalent and the message itself indicates "de-DE" and "de-DE" respectively
so the program's thread's UI culture is correct.

John


"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> wrote in
message news:u8DYewHvEHA.1988@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization John Bowman
11/1/2004 6:58:03 AM
Yes,

John


"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> wrote in
message news:ujeIZ45vEHA.1404@TK2MSFTNGP11.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization John Bowman
11/1/2004 7:12:58 AM
Michael,

Perhaps I should explain a bit further in case it helps figure out what's
wrong. I took a test PC and reformatted the hard drive and installed German
Win2K Pro from a recent MSDN subscription DVD. Setup was ALL in German.
Note, I did not bother w/ Win2K's SP's. Then I went to the MS Download site
and found the .NET 1.1 framework for German. Pulled it down and burned it to
a CD. I went over to the test PC and installed the German .NET 1.1. I then
carried over (on CD) the simple test app as described earlier and ran it.
The MessageBox behaves as described below.

John


"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:evV9tJBwEHA.3376@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization Michael \(michka\) Kaplan [MS]
11/1/2004 7:44:28 AM
Ok, and you recompiled the test app on the German machine, so that there was
literally no English anywhere in the process?


--
MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.



"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:#EJXDSBwEHA.1264@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization John Bowman
11/1/2004 10:30:36 AM
Michael,

The development environment was never installed on the German machine & no I
did not recompile it on the German machine either using the command line
compiler. That's a huge nuisance for a simple test app. From an
internationalization vantage point, I sure hope that is not required. Based
on the documentation for internationalizing .NET app's, we were expecting to
send out resource files and build satellite resource dll's, not recompile
the app locally! Repompiling the EXE locally is a totally unacceptable thing
to do.

John


"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> wrote in
message news:eyMQPmCwEHA.1260@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Re: MessageBox and Internationalization Michael \(michka\) Kaplan [MS]
11/1/2004 10:46:19 AM
I was not suggesting that you would have to do that -- I was just trying to
understand what was done.

So this was not a test of sattelite resource DLLs (yet), but was a test of
the behavior of MessageBox, right? I'll admit it does not match what I
thought it would do, either.


--
MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.


"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:u4DbfADwEHA.1976@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]
Re: MessageBox and Internationalization John Bowman
11/1/2004 3:44:39 PM
Michael,

[quoted text, click to view]

I didn't mean to sound ornery... sorry if I did. In fact, your answer made
me breathe a big sigh of relief <g>. Thanks again, for your continued help
& patitence. You are correct, this was simply a test of what the MessageBox
would do. I've already managed to get the satellite resource Dll's stuff to
work in another test app. The only thing we can't seem to get cooperating is
the MessageBox itself.

John


"Michael (michka) Kaplan [MS]" <michkap@online.microsoft.com> wrote in
message news:unaD0LEwEHA.3716@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]
Re: MessageBox and Internationalization John Bowman
11/2/2004 10:29:01 AM
Michael,

I finally figured out what's going on... I feel like an idiot. Notice the
line of code below that I included in a previous message. This
MessageBox.Show() call is a simple "OK" button. When run in English "OK" is
"OK", but when run in German "OK" apparently also translates to "OK". Thus,
I saw what I thought was no translation. When I change the call to use
MessageBoxButtons.YesNoCancel (or any other button combination types) the
translated ones dutifully appear. It's just that "OK" is the same in
numerous languages and I never thought of it. Would it be possible to have a
link added to the MSDN doc's about MessageBox to clearly state that the
button texts are automatically translated into the local culture's
appropriate equivalents? Furthemore, "OK" may be the same in numerous
languages. Nothing actually states either of these things anywhere that I
can find and it has caused me to waste a lot of time on this issue and it
would be nice to help others not fall into this same trap.

[quoted text, click to view]


Sorry to have wasted your time.

John

"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:OgZR%23vFwEHA.3416@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]
Re: MessageBox and Internationalization Michael \(michka\) Kaplan [MS]
11/4/2004 10:40:38 AM
I am not sure this is a case that makes sense in the documentation, since in
all of the common cases (user runs the language version of Windows they want
and sees the messagebox they are used to seeing everywhere else) does not
need this and the generic rule for handling localized versions is to either
KNOW language or know someone else who does if you want to test that UI
language is changed properly.

In other words, it did cause some extra pain here in thie particular case,
but only because the UI language of Windows was changed with the expectation
that a particular string would change (something that a regular user of that
UI language would know to be false)....


--
MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.


"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:e8OsQkPwEHA.4028@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]
Re: MessageBox and Internationalization Vinay Chopra
11/4/2004 12:30:42 PM
Hey, I gone through all ur messages,
and after reading the last post, I cant stop myself
from laughing .
Thats really a good entertainment and plz. keep it up.

regards,
VC
"John Bowman john.bowman@thermo.com>" <<Remove this before reply> wrote in
message news:OQdguKDvEHA.1296@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button