[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

localization

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
kzdown
Asked:
kzdown
  • 3
  • 3
  • 2
  • +2
1 Solution
 
ginsonicCommented:
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
 
kzdownAuthor Commented:
what about buttons captions.. etc..?
0
 
ginsonicCommented:
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!

 
penichCommented:
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
 
ginsonicCommented:
What version of Delphi use you penich ?
I have Delphi6 Pro and nothing about Languages option in Project menu :(
0
 
Lee_NoverCommented:
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
 
penichCommented:
I am using DEPLHI 5
0
 
kzdownAuthor Commented:
my final need is to make progrm available to change from one lang to another at runtime...
0
 
mikepjCommented:
I do that "the hard way" by pulling the texts from a database.  That way dealers can translate my app for their country.
0
 
kzdownAuthor Commented:
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
 
mikepjCommented:
Hi kzdown,

The other experts have provided ways to do that (they will work).
0
 
Lee_NoverCommented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now