[fpc-pascal] BoolToStr() with correct locale output

Graeme Geldenhuys graemeg at opensoft.homeip.net
Fri Jun 26 18:58:32 CEST 2009


Vincent Snijders wrote:
> 
> Because I always thought these function were not for users, but for 
> systems, for example to store a boolean in a xml file or to create an 

Your example is a good one and I agree there, but I do think it's for users to. For example, the whole reason I noticed the translation issue, was in my TStringGrid mediator. I displayed records (actually objects) that have a IsActive boolean property. The display mediator I use translates booleans to strings, displays TDateTime in the user specific format, displays TDateTime = 0 (ridiculous 1899-12-30 date) into something more user understandable, displays currencies as the users specified etc... Anyway, all worked except for the English True/False strings (from TTaxRate.IsActive property) return by BoolToStr() which should have been in Afrikaans. Or at least I expected it to be in Afrikaans or whatever other locale was active.

 
Regards,
 - Graeme -

________________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/




More information about the fpc-pascal mailing list