Link to home
Start Free TrialLog in
Avatar of margajet24
margajet24Flag for Singapore

asked on

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..
Avatar of Mighty_Joe
Mighty_Joe

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
Avatar of margajet24

ASKER

Thank you for your quick response Mighty_Joe.

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

thanks
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
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 = ¨éü
ASKER CERTIFIED SOLUTION
Avatar of Mighty_Joe
Mighty_Joe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial