Click here to Skip to main content
13,348,874 members (78,265 online)
Click here to Skip to main content
Add your own
alternative version


48 bookmarked
Posted 17 Nov 1999

Multilingual Application - Change Application Language

, 17 Nov 1999
Rate this:
Please Sign up or sign in to vote.
Multilingual Application - Change Application Language


Developing applications supporting multiple languages has always been a drag. With the possibility of including several languages into the rc file of a project, the problem is not entirely solved: The operating system is used as a base and decides what language your application is working with.

If as example, the resources contain English and German, the application will use the English resources on an American or British Windows system, and German on a German or Swiss (German) Windows version. Other language versions of Windows will use the default language (English in most cases).

This behavior is acceptable in most cases, but can cause some headaches: A French speaking person might prefer the German version of your application, but gets by default the English version. Under Windows NT and Windows 2000, there is a simple way of adding the functionality for switching between languages.

Please note: This will only work under NT 3.51 and Windows 2000. There were some problems using NT 4.0 SP3 (and earlier?) reported, but I could not confirm them.

Step 1.

Add the desired languages to your resources.


Step 2.

Enhance your code as follows:

 // Place this code in InitInstance()
 m_lang = GetProfileInt("General","Language",0);
  if (m_lang == 0) {
    // switch language to english
  else {
    // switch language to german
  // Add a menu or a toolbar button and attach this method 

  void CLanguageApp::OnLanguageTogglelanguage() 
    if (m_lang == 0) {
    else {
    AfxMessageBox(IDS_RESTART); // tell the user to restart the application



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Daniel Zuppinger
Chief Technology Officer
Switzerland Switzerland
Professional IT developer since 1983. First projects with Cobol, then Pascal, Modula2, C and since Visual C++ 1.0 also with C++. Works since 1986 as Consultant, between 1990 and 2008 for Infobrain in Switzerland, from 2008 until 2013 for enValue (also Switzerland) and currently I'm working for Comfone (Bern, Switzerland).

Married, two daughters, Hobbies : Paragliding, Orienteering, Mountainbiking, Photography

You may also be interested in...

Comments and Discussions

GeneralPlease help Pin
sreejith ss nair18-Sep-05 22:28
membersreejith ss nair18-Sep-05 22:28 
Good Article.

I have a small doubt regarding Globalization/Localization. Hope you can help me out.
I have a web form application where i need to provide more than 50 different localized resource supports. Apart from this, my application supports rich use of stored data (Sql Server Database) and obviously have few list of Listing controls (Repeater , Grid etc).

My requirement comes like this,

a) I need to provide full localized language support in all data which is displaying in each and every page. Regardless of, the name of controls, content of controls etc. To be concise, which ever text that i am displaying through page, need to be localized based on user selected language.

b) Each and every setup needs to contain all supported languages. So user can switch and view content of site in different language.

I stuck in,

1) I am not sure how to localize stored data in database.
2) How will I give or from where i generate localized information for all supported language.

It would be grate if you can help me out through your valid comments.

Sreejith Nair
[ My Articles ]

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 18 Nov 1999
Article Copyright 1999 by Daniel Zuppinger
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid