Solved

Multi-language support

Posted on 1998-10-22
9
187 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 68
Delphi IDE crash without error message ... 7 90
Multiple image collision 13 75
Tvertscrollbox like a whatsapp layout 5 28
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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