Groups | Blog | Home
all groups > dotnet internationalization > may 2006 >

dotnet internationalization : VB.net 2005 Multi Language RESX Project


Cedric
5/4/2006 5:40:02 AM
Hello

I'm currently working on a winform project that must be in 3 languages
(French, English et Polish).

I know that I have to work with *.resx files, (1 for each language, 1 for
the default) but also 1 for each Form.


The problem I have is that I must change the form and modify the objects on
it (Textboxes, labels, comboboxes, etc) in the three language so as to have
the object recorded into the corresponding resx file.

It's a long job so I would like to know if there is a faster possibilty to
include objects into the resx files.

Moreover, How can I internationalize the messages shown in the messageboxes
that I have in my forms still with the 3 languages.

For example say "Bonjour" in French, "Hello" in English and "Cześć" in Polish.

Thanks for your answers
GarrMc NO[at]SPAM online.microsoft.com
5/18/2006 10:49:05 PM
Hello Cedric. From the description of your problem, it sounds like you are
editing controls on each language version of the forms. If you leverage
WinForm's auto-layout features (Autosize properties, FlowLayoutPanel and
TableLayoutPanel controls), you should only need to edit control properties
on the default form. There's a good overview document available here:

http://blogs.msdn.com/permanenttan/archive/2006/03/07/545445.aspx

For message strings, you'll want to store them in the project's default
Resources.resx file. Once all the strings are in this file, then you can
make copies of this file for each language (in Windows Explorer), renaming
each for the target language (e.g., Resources.fr.resx for French). You can
then call the string via the default ResourceManager object like so:

' VB
MessageBox.Show(My.Resources.msgHello)
// C#
MessageBox.Show(Properties.Resources.msgHello);

Cheers,
Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

[quoted text, click to view]

AndrewEames
5/24/2006 4:24:02 AM
Don't copy the .resx file using Windows explorer - IMHO this is a big mistake
since you copy all the resources you dont want to localize too. e.g. If you
have a button location at x,y , copy the resources file to french and then
move the button in English, the French location of the button doesn't change

A better way to create the localized .resx files is to set the Localized
property of the form to true, set the Form's language to the language you
want and then create a dummy resource (to force VS to create the file)
Andrew

[quoted text, click to view]
GarrMc NO[at]SPAM online.microsoft.com
5/31/2006 11:40:25 PM
I apologize if my response caused any confusion. Yes, for Windows Forms
RESX files you will want to use the Localizable and Language properties.
When I recommend copying the RESX file, I'm referring to the Resources.resx
file, which is not manipulated by the WinForms Designer and does not
contain control properties (unless you manually add them to this file).

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------

[quoted text, click to view]
AddThis Social Bookmark Button