[Lazarus] Translations / Localizations for controls at design time

Marco van de Voort marcov at stack.nl
Thu Aug 2 15:57:31 CEST 2012


On Wed, Aug 01, 2012 at 08:39:19AM +0200, Reinier Olislagers wrote:
> > http://sourceforge.net/projects/dxgettext/
> > 
> > Some advantages:
> > open source;
> > Automatic extract of name of components from form;
> > Manually include text to translate (addition to the above) 
> > using .po files
> > Automatic add translation in .exe (with right-click);
> > Automatic choose of language depending on Local Settings;
> > Manual setting of language (if someone don't want previous option);
> > Very easy to use (even I can use it ;) )
> 
> Their website says:
> Supports for Kylix 3, Delphi 5, 6, 7, 2005, 2006, 2007, 2009,
> FreePascal, Lazarus and C++ Builder.
> 
> so perhaps that already has been done?

I use this at work for Delphi  (2009..XE), and how it works depends
strongly on Delphi versions. Unicode versions don't need changes to
auto translate resource strings, older versions do.

But since FPC's resource system is different anyway, it is hard to predict
how that would work out.

Basically to internationalize an app in D2009 I had to do the following
things:

- do something at program startup to select the correct language (like
 lazarus my apps allow to change language, but require restarts)
- extract all strings using dxgettext tools to form .po files.
- I (visually) inherit most of my forms from a base form that has a method
  that initializes the gettext translation routines on form creation
- resourcestrings work out the box.
- except when used in structured constants. So _() calls must be inserted
   for those cases
- Changed all places where I runtime change text to use resourcestrings
   and format() variable parts into them

> The descriptions seem to indicate it uses Windows explorer integration
> which I personnally hate, but... it's open source ;)

I like the editor (GORM) too (at least over poedit). ... and it is available
in source.




More information about the Lazarus mailing list