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

Maxim Ganetsky ganmax at narod.ru
Mon Jul 16 22:15:55 CEST 2012


16.07.2012 15:58, Joost van der Sluis пишет:
> 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)

Applied, thanks.

The only requirement for DefaultTranslator unit IMO is that it should 
just work when included to program without explicit calling any procedures.

-- 
Best regards,
  Maxim Ganetsky                  mailto:ganmax at narod.ru






More information about the Lazarus mailing list