* * *

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

Ever

  • New member
  • *
  • Posts: 21
[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

  • New member
  • *
  • Posts: 44
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

Ever

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

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus