Стартовый пул
This commit is contained in:
36
POTranslator/data/potranslate.pas
Normal file
36
POTranslator/data/potranslate.pas
Normal file
@@ -0,0 +1,36 @@
|
||||
unit PoTranslate;
|
||||
{$mode objfpc}{$H+}
|
||||
interface
|
||||
uses Classes, SysUtils, LResources, typinfo, Translations;
|
||||
type
|
||||
{ TPoTranslator }
|
||||
TPoTranslator=class(TAbstractTranslator)
|
||||
private
|
||||
FPOFile:TPOFile;
|
||||
public
|
||||
constructor Create(POFileName:string);
|
||||
destructor Destroy;override;
|
||||
procedure TranslateStringProperty(Sender:TObject; const Instance: TPersistent; PropInfo: PPropInfo; var Content: String); OVERRIDE;
|
||||
end;
|
||||
implementation
|
||||
{ TPoTranslator }
|
||||
constructor TPoTranslator.Create(POFileName: string);
|
||||
begin
|
||||
inherited Create;
|
||||
FPOFile:=TPOFile.Create(POFileName);
|
||||
end;
|
||||
destructor TPoTranslator.Destroy;
|
||||
begin
|
||||
FPOFile.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
procedure TPoTranslator.TranslateStringProperty(Sender: TObject; const Instance: TPersistent; PropInfo: PPropInfo; var Content: string);
|
||||
var s: String;
|
||||
begin
|
||||
if not Assigned(FPOFile) then Exit;
|
||||
if not Assigned(PropInfo) then Exit;
|
||||
if (AnsiUpperCase(PropInfo^.PropType^.Name)<>'TTRANSLATESTRING') then Exit;
|
||||
s:=FPOFile.Translate(Content, Content);
|
||||
if s<>'' then Content:=s;
|
||||
end;
|
||||
end.
|
36
POTranslator/potranslator.lpk
Normal file
36
POTranslator/potranslator.lpk
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<Package Version="4">
|
||||
<PathDelim Value="\"/>
|
||||
<Name Value="potranslator"/>
|
||||
<Type Value="RunAndDesignTime"/>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<OtherUnitFiles Value="data"/>
|
||||
<UnitOutputDirectory Value="data\lib\$(TargetCPU)-$(TargetOS)\"/>
|
||||
</SearchPaths>
|
||||
</CompilerOptions>
|
||||
<Files Count="1">
|
||||
<Item1>
|
||||
<Filename Value="data\potranslate.pas"/>
|
||||
<UnitName Value="PoTranslate"/>
|
||||
</Item1>
|
||||
</Files>
|
||||
<RequiredPkgs Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item2>
|
||||
</RequiredPkgs>
|
||||
<UsageOptions>
|
||||
<UnitPath Value="$(PkgOutDir)"/>
|
||||
</UsageOptions>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
</Package>
|
||||
</CONFIG>
|
21
POTranslator/potranslator.pas
Normal file
21
POTranslator/potranslator.pas
Normal file
@@ -0,0 +1,21 @@
|
||||
{ This file was automatically created by Lazarus. Do not edit!
|
||||
This source is only used to compile and install the package.
|
||||
}
|
||||
|
||||
unit potranslator;
|
||||
|
||||
{$warn 5023 off : no warning about unused units}
|
||||
interface
|
||||
|
||||
uses
|
||||
PoTranslate, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPackage('potranslator', @Register);
|
||||
end.
|
Reference in New Issue
Block a user