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

replacing consts.pas

Posted on 2002-06-04
Last Modified: 2010-04-04
i would like to generate my own consts.pas because i use the english version of delphi but need a german application.
Therfore i would like to replace some text in that consts, but it didn't work.

For example.
In english the
  SmkcCtrl = 'Ctrl+';
i changed to
  SmkcCtrl = 'Strg+';

but the menus still shows "Ctrl+A"

how can i make this work ?

Question by:Dev6
  • 4
  • 3
  • 2
  • +1
LVL 27

Expert Comment

ID: 7053898
as far as i know,
the hotkey-shortcut
is retrieved from the os
at runtime

Expert Comment

ID: 7053904
Not sure if this is your problem but if you don't recompile the Consts.pas, and replace the one in $(DELPHI)\lib with the new one you will never get it to work.

Hope it helps a bit..

Author Comment

ID: 7053928
@kretzschmar: I don't think it is retrieved from OS, because i use a german OS and english Delphi, but still get Ctrl instead of Strg !

How can i recompile the consts.pas ?
i just changed the original consts.pas ...
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 27

Expert Comment

ID: 7053943
>i use a german OS
doesn't matter
LVL 27

Expert Comment

ID: 7053947
but i may wrong, of course

there is api-call,
which returns the name,
just test it

more this evening

Author Comment

ID: 7053969
the problem is, i don't need a API-call, but if i set the shortcut property of a menuitem or action, i get 'CTRL-A' this isn't from the OS, because all other applications (they are german) are using 'STRG-A'

Expert Comment

ID: 7054039
hmm...well...i guess simply renaming $(DELPHI)\lib\consts.dcu to something else would force delphi to recompile the Consts.Pas...if not you might have to include the path to it in your Environment, or simply move consts.pas to $(DELPHI)\lib


Author Comment

ID: 7054122
i just deleted all consts.pas and consts.dcu i found on my system and only the one consts.pas exists (with the german text) but it doesn't work.

i put the menus.pas into my project directory.

MenuKeyCaps: array[TMenuKeyCap] of string = (
    SmkcBkSp, SmkcTab, SmkcEsc, SmkcEnter, SmkcSpace, SmkcPgUp,
    SmkcPgDn, SmkcEnd, SmkcHome, SmkcLeft, SmkcUp, SmkcRight,
    SmkcDown, SmkcIns, SmkcDel, SmkcShift, SmkcCtrl, SmkcAlt);

This is the array, which holds all the Special Text for the menus, but the Smk... are defined in the consts, and there are allready the right values. But at runtime, the array holds for the Ctrl key 'Ctrl+'

Why ?
LVL 12

Accepted Solution

Lee_Nover earned 200 total points
ID: 7054895
you should copy the consts.pas to your project folder
do whatever changes need to be done
then recompile the project
if necessary Build the project
that will surelly use your modified consts.pas

Author Comment

ID: 7055715
I don't know why, but now i work ...
I put the file into the project path ...
and it works ...


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Delphi - replicating a form 8 81
Tviruailstringtree sort multi columns on header click 1 74
DBGrid or StringGrid ? 6 105
MS Access from Delphi 31 60
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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