Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Changing Consts.dcu

Posted on 2004-11-04
Medium Priority
Last Modified: 2010-04-04
I have got one Consts.dcu with English strings and another Consts.dcu for another language.
Is it possible in an application to shift between these two in runtime?
Question by:rainbowsoftware
  • 3
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12493328
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12493340
However, an alternative would be to use language resources, combined with Delphi's multi-language support. There are quite a few techniques to support multi-lingual support, however this does mean that you have to think ahead and change all string constants into resourcestring constants.

Expert Comment

ID: 12522774
do you mean you have all your strings in dcu`s ?
or do you mean that the delphi specific strings are in the consts.dcu?
(that are part of the compiler)
LVL 17

Accepted Solution

Wim ten Brink earned 250 total points
ID: 12532672
For multi-lingual projects I just have strings in *.res files. The main application uses the default (english) resource files and I have additional resource DLL's for the other languages. Those resource DLL's are created by Delphi from the other *.RES files. They also contain the *.DFM's for the other languages in my projects. It's how Delphi's default multi-language support works.
There are several other solutions too, btw. But the default Delphi method is the one I like most, though.

If you look at Consts.pas then you'll notice that all the strings are defined as resourcestring. Thus, during compilation they are stored in the *.res file and not in the compiled code itself. The code and the RES file are merged after compilation is done. But Delphi's multi-lingual support allows you to make translations of the resource files that Delphi adds to the compiled code. These resource files are both the *.DFM files and the *.RES files.

But I believe you need at least the Enterprise version of Delphi for this... :-(

Author Comment

ID: 13343128
Thanks to Workshop Alex for an explanation. Helped me to understand, but unfortunately I have to accept, taht it is not possible to do what I want.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

581 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