I'm trying to learn how to use i18n and .po files to internationalise strings.
A simple test project as follows produces an external SIGSEGV error. Anyone see what I'm doing wrong?
(Win 7, Laz 0.9.29, FPC 2.4.3)
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
btn1: TButton;
btn2: TButton;
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
end;
var
Form1: TForm1;
resourcestring
btn1caption = 'One';
btn2caption = 'Two';
implementation
uses DefaultTranslator,
LResources,
Translations;
const poDirectory = 'C:\LazProjects\Dec10\i18nTest\language';
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormActivate(Sender: TObject);
begin
btn1.Caption:= btn1Caption;
btn2.Caption:= btn2Caption;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
TranslateUnitResourceStrings('unit1', poDirectory + '\fr\project1.fr.po', 'fr', '');
end;
initialization
LRSTranslator := TPoTranslator.Create(poDirectory);
end.
Thanks,
Howard