[Lazarus] TAChart Localization

Werner Pamler werner.pamler at freenet.de
Sat Dec 12 22:54:34 CET 2015


Am 12.12.2015 um 22:23 schrieb Maxim Ganetsky:
> The basic method to solve this is to move these assignments (or assign 
> these values for a second time) to a later stage, e.g. OnCreate event 
> of the GUI designer form.
I could solve it in the meantime by modifying the RegisterXXXX 
procedures used throughout TAChart to store the pointer to the resource 
string instead of the string directly. Hmmh, it does break 
backward-compatibility, but I bet nobody has ever written his own chart 
series so far... Let me see who complains in the forum

--- code begin ---
type
   PStr = ^String;

procedure RegisterSeriesClass(
   ASeriesClass: TSeriesClass; const ACaption: PStr);  // ACaption was a 
string before...
begin
   if SeriesClassRegistry.IndexOfClass(ASeriesClass) < 0 then
     SeriesClassRegistry.Add(TClassRegistryItem.Create(ASeriesClass, 
ACaption));
end;
...
resourcestring
   rsLineSeries = 'Line series';

initalization
   RegisterSeriesClass(TLineSeries, @rsLineSeries);
---- code end ---






More information about the Lazarus mailing list