[Lazarus] TAChart Localization

Maxim Ganetsky ganmax at narod.ru
Sun Dec 13 13:26:12 CET 2015


13.12.2015 0:54, Werner Pamler пишет:
> 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 ---

It does not look nice. You are hacking around const specifier.

-- 
Best regards,
  Maxim Ganetsky                  mailto:ganmax at narod.ru




More information about the Lazarus mailing list