Recent

Author Topic: Localization of dialogs (MessageDlg, ShowMessage, etc)  (Read 1886 times)

ertank

  • Sr. Member
  • ****
  • Posts: 274
Localization of dialogs (MessageDlg, ShowMessage, etc)
« on: July 28, 2017, 10:37:21 pm »
Hello,

I am currently using Lazarus 1.8.0RC3 on a Raspberry Pi, Raspbian Jessie. Application I am working on requires me to localize dialog buttons.

I have searched for the subject, but I could not find something as a solution/link provided in forum posts. Moreover, most of the questions were several years old and we have fpc 3.1.1 and Lazarus 1.8.0 today.

One of the things I have tried was to use TranslateUnitResourceStrings() function to localize. But, it did not work for me using as follows:
Code: [Select]
uses
  Translations;

procedure TfrmMain.FormCreate(Sender: TObject);
begin
  TranslateUnitResourceStrings('LCLStrConsts', 'lclstrconsts.tr.po');
end;

Above code, project compiles OK. However, MessageDlg() continues to display button captions in English.

I appreciate any help.

Thanks & regards,
Ertan

ertank

  • Sr. Member
  • ****
  • Posts: 274
Re: Localization of dialogs (MessageDlg, ShowMessage, etc)
« Reply #1 on: July 28, 2017, 10:46:38 pm »
OK, as usual, found the solution after I post my message.

I understood that I need to have file distributed with my application. So, my initial post works *if* I copy lclstrconsts.tr.po file in my application directory.

Thanks.

 

TinyPortal © 2005-2018