Multi Language Applications

Posted on 1997-08-01
Last Modified: 2009-04-17
We are a system integrator writing applications for industrial control systems using Visual Basic "Man Machine Interfaces" (MMI) and C++ for most control functions.  We have had numerous requests to provide multi-language MMI’s .  These are Client/server applications using Windows NT the standard TCP/IP network services.

Previously we supplied many non-windows based systems using an industrial 68000 based computer programmed in "Forth".  We supplied systems for English/Spanish, English/French, English/Polish, and English/Russian.  To accomplish this, we stripped out all the text in both the MMI and the reports, built a file with English statements and corresponding "Second Language" statements.  We then were able to, by means of a "Two Position" selector switch, switch from one language to the other.

I am looking for any products or ideas that will assist me in this type of system. Any ideas???
                                           Richard Jorgensen
Question by:rjorgy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Accepted Solution

dansari earned 100 total points
ID: 1429183

The best way the have a multi-language interface in VB, where the user can switch between languages from within the program, is this:

Make up a .res (resource) file using Visual C++ or another tool, and store all the English phrases (used for labels, message boxes, etc) beginning from ID 0, say, and all the French strings from 10000, say.  In the VB program, assign the Tag property of a label control to the ID from offset 0 that describes the label in English.  If the user has French selected, then add 10000 to the Tag value of that label to get the French description.

In the Form_Load event, loop through all the controls in the form with:

for each ctl in controls
  ctl.label = LoadResString(ctt.Tag + nLanguageBase)

You might want to put this in a separate routine that is called from Form_Load as well as from the place where the user switches to another language.

Since you can have only one .res file in a VB project, strings for all the languages must be in that one file - you can't have multiple .res files, each containing strings for one language.  That's why you must use the offset nLanguageBase (10000 for French, in this example).

If you need further clarification, don't hesitate to contact me -

Hope this helps.

Author Comment

ID: 1429184
I will let you know how it works out.

Author Comment

ID: 1429185
I will let you know how it works out.
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.


Author Comment

ID: 1429186
I will let you know how it works out.

Expert Comment

ID: 1429187

Here's some code I found somewhere, (better version of the above):

me.caption = loadresstring(cint(me.tag))

for each ctl in me.controls
  if isnumeric(ctl.tag) then
    if err = 0 then
      ctl.caption = loadresstring(cint(ctl.tag) + nLanguageBase)
    end if
  end if

So, for all controls on the form that *do* have a numeric Tag property value, this code will attempt to load the resource string into that control's caption.

Expert Comment

ID: 1429188
Damn, that should be

me.caption = loadresstring(cint(me.tag) + nLanguageBase)

Iterative programming.

Author Comment

ID: 1429189
Thanks again

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 - Compare and highlight cell not the same 3 61
SLMGR Switches Are Not Working On KMS Host 3 169
VBA: Select SQL query based on a config Sheet v2 11 55
Problem to line 23 79
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question