Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Multi Language Applications

Posted on 1997-08-01
Medium Priority
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 400 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 - daniel@cherniak.on.ca

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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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