Lazarus

Programming => LCL => Topic started by: Ever on October 23, 2018, 01:14:20 am

Title: [SOLVED] Support with LazReport
Post by: Ever on October 23, 2018, 01:14:20 am
Regards

    I need to know what I have to do so that the designer of LazReport when using it at runtime in my developments, will be seen in Spanish and not in English.

   Thank you
Title: Re: Support with LazReport
Post by: mtournay on October 23, 2018, 09:04:42 am
Hi

you have to include lr_const.xx.po in your language directory and call next func from your lpr

Code: [Select]
uses translations, gettext;
...
...
procedure AddTranslation(const ConstFileName: string);
var
  PODirectory, Lang, FallbackLang: string;   
begin
  PODirectory := ExtractFilePath(Application.Exename) + 'languages\';
  Lang := '';
  FallbackLang := '';
  GetLanguageIDs(Lang, FallbackLang); // in unit gettext
  Translations.TranslateUnitResourceStrings(ConstFileName, PODirectory + ConstFileName+'.%s.po', Lang, FallbackLang);
end;

this work for LCL, LazReport, ...

regards
Title: [SOLVED] Support with LazReport
Post by: Ever on October 24, 2018, 04:57:05 pm
Thanks for your help, it worked perfectly
TinyPortal © 2005-2018