Mulitilingual app

  • Thread starter Thread starter wndr
  • Start date Start date
W

wndr

Hi Guys.
I need to develop multilingual windows forms application. What is the best
way to do that, and where could I get good info.
Thanks in advance.
 
Hi Guys.
I need to develop multilingual windows forms application. What is the
best way to do that, and where could I get good info.
Thanks in advance.

Look up globalization/localization on the MSDN site. There are some good
articles from Michele Leroux Bustamante that are good starting points. As
for how to change the UI, it is a matter of using resource files.

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Hi Gregory.
Thank you for helpfull sugestion.
The way if controls are on a form at design time, works. The problem is that
I have a form, and all controls on that form I create dinamically, from the
source code, at run time. Is there any sample code I can have an idea from
for mutilingual applications?
Thank you.
 
wndr said:
Hi Gregory.
Thank you for helpfull sugestion.
The way if controls are on a form at design time, works. The problem is that
I have a form, and all controls on that form I create dinamically, from the
source code, at run time. Is there any sample code I can have an idea from
for mutilingual applications?
Thank you.
[...]

Hi,

Add a resource file to your project.
Edit the resource file.
Repeat above for all the locals that you want to support.
Access the resource from your code.

Example:

// declare below
private ResourceManager resourceManager;

// at your form constructor
resourceManager = new
ResourceManager("WindowsFormsApplication1.Resource1", GetType().Assembly);

// somewhere in your method
// create the label dynamically
var label = new Label()
Controls.Add(label);

// access the resource
label.Text = resourceManager.GetString("String1");

Refer below MSDN site for details,
http://msdn.microsoft.com/en-us/library/y99d1cd3.aspx

Regards.
 
Thank you so much.
It works.

kndg said:
wndr said:
Hi Gregory.
Thank you for helpfull sugestion.
The way if controls are on a form at design time, works. The problem is
that I have a form, and all controls on that form I create dinamically,
from the source code, at run time. Is there any sample code I can have an
idea from for mutilingual applications?
Thank you.
[...]

Hi,

Add a resource file to your project.
Edit the resource file.
Repeat above for all the locals that you want to support.
Access the resource from your code.

Example:

// declare below
private ResourceManager resourceManager;

// at your form constructor
resourceManager = new
ResourceManager("WindowsFormsApplication1.Resource1", GetType().Assembly);

// somewhere in your method
// create the label dynamically
var label = new Label()
Controls.Add(label);

// access the resource
label.Text = resourceManager.GetString("String1");

Refer below MSDN site for details,
http://msdn.microsoft.com/en-us/library/y99d1cd3.aspx

Regards.
 
Back
Top