Zitat von zaher dirkey <[EMAIL PROTECTED]>:

>[...]
> > 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.

.po files can be compiled in. Either via lrs or resources.
OTOH a library should load the translations on start.
So the compiled .po files can be used as nice default. But you get into trouble
if the library gets successful and translated to many languages. So loading
support is a must for a good library.


> > 2) Include files with Constants. This is what I'm starting with for
> > now. A gfx_constants.pas unit with $Defines for each supported
> > language. Depending on which define you have active, it will pull in
> > the correct language .inc file with resource strings. If no define has
> > been specified, it defaults to English.[...]

This will just make the strings faster and consume less mem+bytes, which is
hardly measurable for typical libs.


> >  eg:
> > ----------------[ gfx_constants.pas ]---------------------
> > ....
> > resourcestring
> >
> > { Define Compiler language symbol (eg: gr for German) to include the
> > correct
> >  language resource file otherwise the Default (English) resource file will
> >  be used. }
> >
> > {.$DEFINE gr}     // German
> > {.$DEFINE ru}     // Russian
> > {.$DEFINE fr}     // French
> > {.$DEFINE pt}     // Portuguese

Don't use custom abbreviations. When the library grows then 'greek' might be
added and you get into naming trouble. (And germans start searching for de, not
gr)


> >[...]
> > 3) ????  Anybody got any other ideas?  Remember, this is localization
> > for a Toolkit, not for a application.  GetText works perfectly for a
> > application.

And for libraries.


Mattias

_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to