Recent

Author Topic: [SOLVED] Support with LazReport  (Read 1942 times)

Ever

  • Jr. Member
  • **
  • Posts: 61
[SOLVED] Support with LazReport
« 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
« Last Edit: October 24, 2018, 04:57:40 pm by Ever »

mtournay

  • Jr. Member
  • **
  • Posts: 63
Re: Support with LazReport
« Reply #1 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
laz 2.06 32b - fpc 3.04 32b - win10 64b

Ever

  • Jr. Member
  • **
  • Posts: 61
[SOLVED] Support with LazReport
« Reply #2 on: October 24, 2018, 04:57:05 pm »
Thanks for your help, it worked perfectly

 

TinyPortal © 2005-2018