Solved

Yes/No/Cancel localization?

Posted on 2003-11-08
7
376 Views
Last Modified: 2010-04-05
Hello,
How can I change mbYes/No/Cancell etc. MessageBox Flags to my national words? -Also, when I'm planning an international version could it be read from Windows?

Jacek
0
Comment
Question by:JacekH
  • 3
  • 3
7 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 9708080
just use

windows.messagebox(..

the captions will be displayed in the os-language version

meikl ;-)
0
 
LVL 1

Expert Comment

by:JackNaif
ID: 9708171
Perhaps your problem is just the opposite? You are writing a programme that should run in the language it is meant to run rather the language of the version of Windows it is run on?
For example: If your progamme is in French, and it's running on an English release of Windows, if you use messagebox, application.messagebox, showmessage, messagedlg and the like, you will get stuff like:

Etes-vous sure que vous voulez faire ça?
Yes     No   Cancel


Or if your programme is in English and Windows in Spanish:

Are you sure you want to do that?
Sí      No     Cancelar

The answer is simple: if you want Window's language for your buttons, just use this functions.
If you want to be in control of the language of this messages, write your own procedures or functions that create forms with this buttons and labels as needed with the message to be shown, and internationalize (what an ugly word for "translate") the captions in those forms in the same way you are internationalizing all the rest of the application.

Hope it helps:

Jack
0
 
LVL 1

Expert Comment

by:JackNaif
ID: 9708201
One more detail:

Bear in mind that, if you want to use the Windows language, then the values in the set of buttons are the same for any language:

if you include mbYes, you won't get a button saying "Yes". You'll get a button saying whatever word means "Yes" in whatever the language of Windows.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 9708264
jack,

>messagebox, application.messagebox, showmessage, messagedlg

all these functions are providing a caption depending on the language
of the delphi release rather than in the language of the os

using os-caption, u have to use the windows-api, which is
most wrapped the the windows-unit

or as you stated is to define a own form for the dialog

meikl ;-)
0
 

Author Comment

by:JacekH
ID: 9708461
Thanks to all. It seems I have to prepare some forms more :)
I have English WinXP but want to run my programs on Polish and German windows. I have to be sure that users get all this Yes/No/Cancel translated to their Ja/Tak etc. ;) I also found consts.pas unit with those descriptions which I have to experiment with :)

Thanks and regards,
Jacek
0
 
LVL 1

Expert Comment

by:JackNaif
ID: 9715228
No, Meikl. You're right about MessageDlg and ShowMessage. They use captions for the buttons taken from Delphi (from Consts.pas, actually).
MessageDlg also gets it window title from there.
ShowMessage uses the name of the executable (with the .exe trimmed off) as caption for the form.

But MessageBox and Application.MessageBox take the caption of the form as a parameter and the captions for the buttons from Windows, because MessageBox is a Windows API call and Application.MessageBox is just a wrapper for it.

Regards:

Jack
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9715323
yep, jack, you're right about messagebox, missed this ;-)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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…

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

10 Experts available now in Live!

Get 1:1 Help Now