Solved

Multi-language support

Posted on 1998-10-22
9
190 Views
Last Modified: 2010-04-06
Hi,
Whe are using Delphi 4.0, the customers wants his application in two languages ( Dutch and Frensh ). What is the best way to handle this. If you guys would have some examples or hints ... , I consider the maintenance part of it very important as the felxibility. We do not want to buy a product! And we want to give the user the possibility to swith between the two different languages at runtime
0
Comment
Question by:castelli
[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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1343970
Hi castelli,

 If you don't want to buy a product, then the maintanance part can be difficult.

There are several ways to do it :

 1. Making a .Ini file with all your translations
 2. Making a .res file with all your translations

Now, you can define Dutch=1 And French=2

Selecting a language will be something like

function ChangeLanguage(laguage:...);
begin
 {with ini file }

 Mybutton.Caption := load from dutch section of inifile
  or load the inifile {naam}.DUT
 
 {with res file}

 case language of
  Dutch : level := 1
  French : level := 2
 end;

 Mybutton.Caption := Load string 100+Level

etc....

as I said hard to maintain etc, offcourse you can make tools to make it easier,... but then why not buy one which is already proven?

Zif.
 

0
 
LVL 4

Expert Comment

by:siabod
ID: 1343971
The way i use to do it is make a database with different tables for each language but with the right words on the right place

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1343972
siabod, also possible but then you need the BDE. what if the program itself doesn't uses the BDE? Then you've the BDE only for your language support.

But, still good idea, you can use the QDB components for this, they don't need the BDE.
http://home.sprynet.com/sprynet/rrm/index.html

And the maintance is easier to make offcourse with such database-alike components.

Regards, Zif.
0
Independent Software Vendors: 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!

 
LVL 12

Expert Comment

by:rwilson032697
ID: 1343973
The way we do it is to convert literal strings into a function call

eg: ShowMessage('Fred was here') becomes
    ShowMessage(DVMStr(S_xxxxx_Fred_Was_here));

Where xxxxx is a number given to the string.

We then have a .RC file with the following entries

#DEFINE S_xxxxx_Fred_Was_here = xxxxx

and in the String table section

S_xxxxx_Fred_Was_here  = "Fred was here"

Strings that are part of components are taken care of by a set of derived components which have an additional property which is the string ID for the literal string. A couple of utilitie do clever things like extracting the strings fro mthe forms and setting the string resource IDs.

You can then translate the .RC file into the language of your choice.

We produce a DLL from the .RC file. The program loads the DLL and extract strings from it (thats what the DVMSTR function call does). If you have a french DLL your program turns into French - with a Dutch one its turns into Dutch! With a DLL you can even have the strings shown in the translated language in the forms at design time...

I hope this helps,

Raymond.

There are other components etc you can get from DSP et al but none of them were capable of doing what we needed (like support ~10,000 translatable strings over a dozen programs written in C, C++ and DELPHI)

0
 
LVL 4

Expert Comment

by:itamar
ID: 1343974
Hi all,

Come on ! Take a look at TMultiLang:

http://www.preview.org/e/mldl.shtml

It´s about $ 49, and make things very much easier.

It doesn´t worth to spend even an hour to think about .RC, .RES, etc...

IHTH,
Itamar

0
 
LVL 4

Expert Comment

by:itamar
ID: 1343975
Ooops !

They increased the price to $89 with source code.
0
 
LVL 2

Accepted Solution

by:
Thaddy earned 100 total points
ID: 1343976
Delphi 4 contains a VERY GOOD wizard for this Job.
I recommend this highly, as it provides for the best way to integrate multilanguage support on the operating system level (win98, NT4/5).
Basically what the wizard does is isolating all stringresources and forms in a language specific directory and creates a resource DLL project for you.
Now, translate the resources and form files in the directories
(.\DUT and .\FRA) into the proper language, compile the DLL and,
based on the locale setting of the operating system the proper resource dll is loaded. (you can override this behaveour).
This is compliant with the most recent microsoft design guidelines and the way we at cyco software work with our PerfectView product). Also, MS provides a translation database that contains the 'proper' standard translations.


0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1343977
Hey thaddy, that's interesting to know... again a plus-point for me to tell my boss I need D4. Can you also give some source? Zif.
0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1343978
Zif,

That's the neat part.....
...There is no source.... well, Just two directories and
two readily compilable resource dll's!
The delphi executable will automatically try to load the proper
resource dll by reading the system locale.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Base1 Encode/Decode 3 90
Firemonkey android show image from resource ? 1 58
Slow Restore if incremental backups using RDiff.exe 4 39
Delphi Seattle StructureView color 1 22
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

696 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