?
Solved

Yes/No/Cancel localization?

Posted on 2003-11-08
7
Medium Priority
?
405 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
[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
7 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 150 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
Technology Partners: 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!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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