I have developend a window application(Win32 API) in visual C++. I have to add multilingual feature in this application. Can any one Pls guide me how to get forward with this task.
the basics for a multilingual application on Windows is the use of "resources". a resource is a chunk appended at the end of your executable, which only contains data, and is formatted in a very specific way in order for Windows to be able to interpret those data.
in your resources, you can find dialog boxes, string tables, but also version informations (those which are displayed in the properties dialog box of a file in the explorer). you can watch the resources of any dll or exe by opening the exe or dll in Visual C++. when developing an application, you can create a resource (File/New), add it to your project (the same as you when you add a file) and edit the resources (using the resource editor, generally a tab next to the File View in project explorer).
each resource (dialog, dialog, template, version info, string table, ...) contains a language identifier which you can change. you can create the same resource multiple times using different language identifier. once compiled, when the application is loaded by Windows, it will try to open resources which language are the closer to the Windows UI language.
a set of functions is defined in the Windows SDK to make good use of those resources: LoadString, LoadCursor, LoadBitmap, and everything in the resources chapter.
Now every time you use a string in your code, put it in a String Table resource and use the LoadString function to retrieve it. windows and dialog boxes are generally loaded in the correct language without needing any specific function call, as long as you have set the correct language identifier in the resources.
voila, that's the shortest introduction to multilingual development under Windows that i could do. i am sure that you can find a lot of well-written articles about resources or multilingual development under Windows on the net.
There are several sides you have to worry about:
For localization the best current practice is to no use strings in your code, but store them in resource-only DLLs (or "satellite DLL") Probably best to start from here: http://msdn.microsoft.com/en-us/goglobal/bb978454.aspx, especially the tutorials and presentations on the right.
For the localization work down to detail, you can check this: http://mihai-nita.net/2007/05/03/how-to-localize-an-rc-file/
For locale-aware behavior you have to use special APIs like GetNumberFormat or GetDateFormat. You can probably start from here http://msdn.microsoft.com/en-us/library/dd319078%28VS.85%29.aspx or here http://msdn.microsoft.com/en-us/goglobal/dd565826.aspx
But of course no answer here will be enough, since there are full books on the topic. So just start from the MS globalization portal (http://msdn.microsoft.com/en-us/goglobal/), especially the "Learn" tab, and o from there.
And when you bump into some troubles (you most likely will), stop by at the microsoft.public.win32.programmer.international newsgroup (I know, taking someone away from stackoverflow might not be "good form", but there is a dedicated place, so you might get better answers).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With