You can use the Persistor to switch between
languages at runtime or design time. Place a persistor on you form and
specify that you want it to work with the Caption and the Hint
properties of all components.
This is done by assigning the following
text to WhichProperties.
TComponent=Hint,Caption
Now you can save and restore the these
properties at design time or run time. At run time you can call
SaveToFile and LoadFromFile and at design time you can set the Command
property to pcSaveToFile or pcLoadToFile. You can also use the
property editor.
The values of the properties can be saved
in the regsitry or a file.
The registy or filepath can be specified in
terms of the the formname, formtype, formcaption and the value of the
config property. If you place your persistor on a ancestor form, you
can use the constants "<Formname>" or
"<Formtype>" to modify the path of the storage. E.g.
c:\Program files\MyComp\MyAppl\Lang\<Formtype>.txt
or
\SOFTWARE\MyComp\MyAppl\Lang\Danish\<Formtype>.txt
The Config property can be included in the
pathname to flexibly switch between various configurations, such as
languages or expert levels. E.g.:
\SOFTWARE\MyComp\MyAppl\<Config>\<Formtype>.txt
When you call LoadFromFile or SaveTofile,
<Config> will be replaced with the value of the Config string
property.