[Lazarus] Changing the translation of forms while the program is running

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Jul 16 12:49:42 CEST 2012


On 16 July 2012 11:27, Bart <bartjunk64 at gmail.com> wrote:
> This would make maintanance (large menu's, active devolopment of forms
> in question) lots easier.

What I did is to encapsulate setting up captions to a single method,
SetupCaptions, on each form. I use form inheritance, so each form
simply needs to override that method. That method is called in
FormCreate to setup all components. If the application language
changes at runtime, I ask fpgApplication so broadcast a message to all
loaded forms of the application. Those forms receive the message, and
execute the SetupCaptions method again. Works like a charm.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the Lazarus mailing list