Solved

localization

Posted on 2002-06-18
12
189 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
 

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

13 Experts available now in Live!

Get 1:1 Help Now