[Lazarus] Localization in toolkit like fpGUI

Michael Van Canneyt michael at freepascal.org
Tue Feb 19 09:37:46 CET 2008



On Tue, 19 Feb 2008, Graeme Geldenhuys wrote:

> Hi,
> 
> I know this is not directly related to Lazarus, but I thought with all
> the experience collected and that Lazarus supports localization, I
> might get some good ideas here...
> 
> I want to localize the fpGUI toolkit. Standard dialogs, error
> messages, etc... What is the best way to approach this.
> 
> 1) GetText: This was my first thought, but that means every fpGUI
> based application needs to ship with external .po files which I don't
> like and don't want. fpGUI based applications must preferably be a
> single executable at best.  GetText works great for your own
> applications, but not for the GUI framework I think.

GetText is not sacred: it is just one mechanism to handle resourcestrings.

The resources branch has a complete implementation of resources for ALL
platforms supported by FPC. You can store the resource strings in resources,
(as delphi does) and link in the correct resources. Normally, the resource
support should be merged in to trunk.

My recommendation is to go with resource strings as you would do now with
constants, and when the compiler has the needed support, switch it to 
a single resource file.

Michael.



More information about the Lazarus mailing list