?
Solved

Multi Language Applications

Posted on 1997-08-01
7
Medium Priority
?
249 Views
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
0
Comment
Question by:rjorgy
[X]
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
7 Comments
 
LVL 3

Accepted Solution

by:
dansari earned 400 total points
ID: 1429183
Richard,

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)
next

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.
0
 

Author Comment

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

Author Comment

by:rjorgy
ID: 1429185
I will let you know how it works out.
0
Industry Leaders: 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

by:rjorgy
ID: 1429186
I will let you know how it works out.
0
 
LVL 3

Expert Comment

by:dansari
ID: 1429187
Correction:

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

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

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

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.
0
 
LVL 3

Expert Comment

by:dansari
ID: 1429188
Damn, that should be

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

Iterative programming.
0
 

Author Comment

by:rjorgy
ID: 1429189
Thanks again
                 Dick
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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

777 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