Solved

localization

Posted on 2002-06-18
12
190 Views
Last Modified: 2010-04-04
i want to localize my program, but i have problem changing captions of some standard windows dialogs,
for example: print dialog, standard msg dialog etc... can someone tell me how to do it and is it possible to do this
at runtime?

thanks in advance.
0
Comment
Question by:kzdown
  • 3
  • 3
  • 2
  • +2
12 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 7090224
procedure TForm1.PrinterSetupDialog1Show(Sender: TObject);
begin
   SetWindowText(PrinterSetupDialog1.Handle,'My title')
end;

This is a sample for PrinterSetupDialog but work for the rest of dialogues is the same way.
0
 

Author Comment

by:kzdown
ID: 7091063
what about buttons captions.. etc..?
0
 
LVL 9

Accepted Solution

by:
ginsonic earned 50 total points
ID: 7091656
Something alike:

procedure TForm1.OpenDialog1Show(Sender: TObject);
begin
   SetDlgItemText (GetParent (OpenDialog1.Handle),
                  IDOK, PChar ('&Please open it!'));
   SetDlgItemText (GetParent (OpenDialog1.Handle),
                  IDCANCEL, PChar ('&No, reject!'));
end;

Or go to Consts.pas . Open it, replace the constants with your own . Compile it and then move the dcu file to your LIB directory.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Expert Comment

by:penich
ID: 7092126
DELPHI allows you to work on multi language appllication.
It provides ITE functionality
See menu Project/Languages/Add...

Please remember that you will need to declare all your String constants as resourcestrings in code. Therefore the titles of all your dealogs should be declared like resourcestring too.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7092425
What version of Delphi use you penich ?
I have Delphi6 Pro and nothing about Languages option in Project menu :(
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7092601
about changing the consts.pas unit
you should first copy it to your projects folder
then do whatever changes you need


ginsonic:
dunno if D6 pro has this but in Ent. you simply install the "Borland Integrated Translation Environment" package
I couldn't find it myself so I looked up in the Packages and found it :)

0
 

Expert Comment

by:penich
ID: 7092740
I am using DEPLHI 5
0
 

Author Comment

by:kzdown
ID: 7093160
my final need is to make progrm available to change from one lang to another at runtime...
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7123799
I do that "the hard way" by pulling the texts from a database.  That way dealers can translate my app for their country.
0
 

Author Comment

by:kzdown
ID: 7124222
hi mikepj.

yes. that what i need to do also. i can do that without problems on the forms i have creted, but when i need to applay changes to some standard windows dialogs (print dialog etc..) i got problems. do you know how to sove these problems?
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7124708
Hi kzdown,

The other experts have provided ways to do that (they will work).
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7125013
why not simply have an ini file like most of the apps have ?
you could make resoruce dlls but then users can't make their own translations
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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
Delphi application Soap connection 5 120
find a node in VST 2 70
Working with hours 3 65
can't find the executable in Simulator 1 100
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…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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