Changing Consts.dcu

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?
rainbowsoftwareAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wim ten BrinkSelf-employed developerCommented:
No...
0
Wim ten BrinkSelf-employed developerCommented:
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.
0
gandalf_the_whiteCommented:
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)
0
Wim ten BrinkSelf-employed developerCommented:
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... :-(
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rainbowsoftwareAuthor Commented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.