Solved

localization

Posted on 2002-06-18
12
192 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
[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
  • 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
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!

 

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

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!

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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