I want to support different languages for my application, I would like to know what is the best way to do it.

1. How is it possible to support the Resource files.

2. What are the efforts to be put into giving this option.

3. How much more coding effort has to be taken into consideration.

I want an application which has to have all Japanese Text ( meaningful to people of Japan ) when it runs in Japan and when it is back to the a particular country , it has to change its resources.

Hoping for some real good explanations.
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.

Developing International Software For Windows 95 and Windows NT
Just mark each resource with the language it represents. Then, you can have it automatically resolved at runtime by the OS.

See the LANGLOAD.ZIP sample at http://www.nwlink.com/~mikeblas/samples/ for a simple example. (Some day, all of my samples will move to http://www.mooseboy.com/ )

If you code your app for Unicode, there's really little else to worry about--except for testing.

..B ekiM
nv3prasadAuthor Commented:
It is difficult if I want to support 100! languages, can you suggest me something better.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Windows directly provides nothing better.

If you want, you can make a DLL that holds each language and write your code to load resources from the DLL instead of directly from your *.EXE image.

To me, that seems harder--though, at runtime, it's probably more efficient. What, specifically, do you find "difficult"? If I can't tell why you think my suggestion is flawed, I'm ill-equipped to offer a remedy more suitable to you.

..B ekiM
There is no one easy answer, but there are several resources (magazine articles etc) that can help.  MS Developer Library has several very good ones.

Generally, you need to do three things:

1 - separate user interface, especially strings, COMPLETELY from your code.  This is easy to do on a new project if you are diligent, but can be quite heinous if you're converting legacy code.

2 - Use generic text representations in code, so that you have no dependencies on whether code is ASCII, UNICODE, or MBCS.  The Windows APIs (actually, header macros) let you do this; look for the t- versions of string functions.  Also, MFC CString is completely compatible and hides all of this from you - very handy.  As with 1, these are easy to do in new code, but absolutely no fun to retrofit onto legacy code.

3 - Now you just need to provide the different user interfaces (in a manner consistent with how you achieved part 1, above), and the mechanisms for switching between them.

Putting different language resources in DLLs, as described by mikeblas, is a fairly common way of doing this; at run time you can load resources from any DLL.  Whoever is doing the translation just needs to produce a DLL with the right resources and resource IDs.

More "modern" is using Microsoft's Message Compiler to compile your message strings into binary resources.  This is fairly complex, I've used them and I'm not even completely sure I know how it all works.  There are some API functions to automatically get and format these strings, based on locale (which can be passed by the caller, or gotten from the user's OS preferences).  The big advantage I can see to this is that you can integrate with the operating system, so that you are "automatically" in the user's preferred language without any additional configuration for your program.  In a multi-user multi-lingual environment, this is very helpful.

If you're having trouble finding help or MS Dev Library articles about the message compiler, look for how to use the NT event log, and possibly NT Services - that was the direction I found it.

I apologize for being so vague about references, but I don't have a development environment in front of me so that's all I can do.  If you have trouble finding the info, let me know and I will see if I can find more concrete references.

Good luck!
No real need to use the message compiler, as string tables can achieve the same result. Message table strings are loadable without intializing the exeutable image they're stored in, and that can be a benefit. They're also a little more efficient than string resources.

..B ekiM
nv3prasadAuthor Commented:
Okay Mike, I am going to give you the points, since you showed me some light at the end of the tunnel. submit this as your answer.


..B ekiM

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
System Programming

From novice to tech pro — start learning today.