Solved

Multi-language support

Posted on 1998-10-22
9
184 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now