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

Joost van der Sluis joost at cnoc.nl
Mon Jul 16 13:58:57 CEST 2012


On Fri, 2012-07-13 at 15:51 +0200, zeljko wrote:
> On Friday 13 of July 2012 15:49:37 Joost van der Sluis wrote:
> > I'm using the DefaultTranslator unit to translate my application,
> but I
> > would also like to switch to another language on-the-fly, thus
> without
> > restarting the application.

> I need that too atm :)

Try the attached patch for DefaultTranslator. With SetDefaultLang('nl')
it will switch the language on-the-fly (to Dutch in this case). 

It will loop through all forms in screens and will change all properties
that are present in the .po-file.

Maybe it is an idea to apply this patch so that others can also use
this? Or should users write their own 'DefaultTranslator' unit? (Then
this one could be added to the Wiki as an example)

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SwitchTranslationsPatch.diff
Type: text/x-patch
Size: 7899 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120716/c56173d4/attachment-0003.bin>


More information about the Lazarus mailing list