Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Multi-language support

Posted on 1998-10-22
9
Medium Priority
?
194 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
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!

 
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 200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

926 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