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

Thanks..
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.

Mighty_JoeCommented:
Hello

What you need to do is set CurrentCulture, which can be done in asp.net page directive or programatically. This can also automaticaly be changed accordingly to the language specified in the browser. Based on this asp.net 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
//Joe
0
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?

thanks
0
Mighty_JoeCommented:
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.

Cheers
0
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.

example
in ini file ,

[ENGLISH]
ERROR_1 = error

[JAPANESE]
ERROR_1 = ¨éü
0
Mighty_JoeCommented:
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..
           
0

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.