how to use localized string?

In my application, I need to localize both GUI and the string that will be displayed whenever an error occurs. I have already finished localizing the GUI using the IDE. Now, I'm having a problem on how to do that with the messages. In the previous version, I used an INI file to read both english and japanese texts.

previous :
string msg = Ini.Read("ENGLISH",ERROR_1);

what i am thinking :
1. Create additional resource file but dont know how to connect it to the application
2. If I create a new resource file, does it automatically merges with the Language DLL which is created from localizing the GUI

Could you please tell me how to deal with this?
If possible, please provide steps

LVL 10
margajet24IT Business AnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


What you need to do is set CurrentCulture, which can be done in page directive or programatically. This can also automaticaly be changed accordingly to the language specified in the browser. Based on this selects the appropiated resource file.

Look at this link:
How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization

You can find more information here:
Localizing ASP.NET Web Pages By Using Resources

Hope that it helps
margajet24IT Business AnalystAuthor Commented:
Thank you for your quick response Mighty_Joe.

I am developing a Windows Application. Do you have any references for this?

Hey again

It is very similar to ASP.NET you add a resource file for each language (and name it appropiate) and set the CurrentUICulture on the current thread.
Then on each control, lable, button and so forth you should set the property Localiseable = true and the name of the control is also the name of the field in the resource file.

See this link:
Globalizing and Localizing Windows Application, Part 2 or this one How to Localize Windows Forms and Change the Language at Runtime for eksampels.

margajet24IT Business AnalystAuthor Commented:
i know how to do it in GUI but what I want to is, localizing the text/strings that will be displayed.

in ini file ,

ERROR_1 = error

ERROR_1 = ¨éü
Okay i see what you mean.. Try this:

ComponentResourceManager mgr = new ComponentResourceManager(typeof(Form1));
string localString = mgr.GetString("ERROR1", System.Threading.Thread.CurrentThread.CurrentCulture);

Remeber to set the CulturInfo to the Thread first..

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.