[fpc-pascal]gettext

Stefan Ziegenbalg stefan.ziegenbalg at mailbox.tu-dresden.de
Thu Sep 12 19:33:51 CEST 2002


Hi,

is there a way to translate const strings manual, like gettext or 
dgettext in C?

Example:

Error(gettext('One ') + s1 + gettext(' Two ') + s2 + gettext(' Three'));

instead of:


resourcestring
   one='One ';
   two=' Two ';
   three = ' Three';

{ 1000 lines of code }

Error(one + s1 + two + s3 + three);


or even


resourcestring
   mes='One %s Two %s Three';

{ 1000 lines of code }

Error(Format(mes, [s1,s2]));


The problem are the "1000 lines of code". It is ugly to define the 
message text 1000 lines away from the place where it occures. And I have 
to keep their name in mind. :-(


Regards Stefan

----------------------------------------------
mailto:stefan.ziegenbalg at mailbox.tu-dresden.de
http://www.sziegenbalg.de
http://www.simage.org





More information about the fpc-pascal mailing list