[Initranslator-svncheckins] SF.net SVN: initranslator: [175] translator/trunk/src
Brought to you by:
peter3
|
From: <pe...@us...> - 2006-12-09 14:19:21
|
Revision: 175
http://svn.sourceforge.net/initranslator/?rev=175&view=rev
Author: peter3
Date: 2006-12-09 06:19:19 -0800 (Sat, 09 Dec 2006)
Log Message:
-----------
General
- Option to set SelectedItem in IApplicationServices (peter3)
- kora username was misspelled as karo - fixed (peter3)
ToolConsistency
- Implemented ILocalizable (kora)
- Auto add shortcuts option added (kora)
Modified Paths:
--------------
translator/trunk/src/ApplicationServices.pas
translator/trunk/src/BaseForm.pas
translator/trunk/src/MainFrm.pas
translator/trunk/src/ToolConsistency/ToolConsistency.dpr
translator/trunk/src/ToolConsistency/ToolConsistencyFrm.dfm
translator/trunk/src/ToolConsistency/ToolConsistencyFrm.pas
translator/trunk/src/ToolConsistency/ToolConsistencyImpl.pas
translator/trunk/src/TransIntf.pas
translator/trunk/src/XilisoftPlugin/XiliSoftParserConsts.pas
translator/trunk/src/XilisoftPlugin/XilisoftParser.dpr
translator/trunk/src/XilisoftPlugin/XilisoftParser.res
translator/trunk/src/XilisoftPlugin/XilisoftParserCfgForm.pas
translator/trunk/src/XilisoftPlugin/XilisoftParserImpl.pas
translator/trunk/src/translator.dof
Added Paths:
-----------
translator/trunk/src/ToolConsistency/ToolConsistencyConsts.pas
Modified: translator/trunk/src/ApplicationServices.pas
===================================================================
--- translator/trunk/src/ApplicationServices.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/ApplicationServices.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -13,8 +13,10 @@
function BeginUpdate: Integer; safecall;
function EndUpdate: Integer; safecall;
function GetAppHandle: Cardinal;
- function GetAppOption(const Section: WideString; const Name: WideString; const Default: WideString): WideString;
- safecall;
+ function GetAppOption(const Section: WideString; const Name: WideString; const Default: WideString): WideString; safecall;
+ function GetSelectedItem:ITranslationItem;
+ procedure SetSelectedItem(const Value:ITranslationItem);
+
function GetDictionaryItems: IDictionaryItems;
function GetFooter: WideString;
function GetHeader: WideString;
@@ -28,6 +30,7 @@
function Translate(const Section, Name, Value: WideString): WideString; safecall;
procedure UnRegisterNotify(const ANotify: INotify); safecall;
+
end;
implementation
@@ -86,6 +89,11 @@
Result := FForm.GetOrphans;
end;
+function TApplicationServices.GetSelectedItem: ITranslationItem;
+begin
+ Result := FForm.SelectedItem;
+end;
+
procedure TApplicationServices.RegisterNotify(const ANotify: INotify);
begin
FForm.RegisterNotify(ANotify);
@@ -107,6 +115,11 @@
FForm.SetHeader(Value);
end;
+procedure TApplicationServices.SetSelectedItem(const Value: ITranslationItem);
+begin
+ FForm.SelectedItem := Value;
+end;
+
function TApplicationServices.Translate(const Section, Name, Value: WideString): WideString; safecall;
begin
Result := FForm.Translate(Section, Name, Value);
Modified: translator/trunk/src/BaseForm.pas
===================================================================
--- translator/trunk/src/BaseForm.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/BaseForm.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -74,25 +74,22 @@
var
W: TAppWindowInfo;
begin
- if GlobalAppOptions.SaveFormPos then
+ if (Self = Application.MainForm) and IsIconic(Application.Handle) or IsZoomed(Handle) then
+ ShowWindow(Handle, SW_RESTORE);
+ W := GlobalAppOptions.WindowInfos[Self];
+ if (W.WindowState = wsMinimized) and (Self = Application.MainForm) then
+ ShowWindow(Application.Handle, SW_MINIMIZE);
+ WindowState := W.WindowState;
+ if WindowState = wsNormal then
begin
- if (Self = Application.MainForm) and IsIconic(Application.Handle) or IsZoomed(Handle) then
- ShowWindow(Handle, SW_RESTORE);
- W := GlobalAppOptions.WindowInfos[Self];
- if (W.WindowState = wsMinimized) and (Self = Application.MainForm) then
- ShowWindow(Application.Handle, SW_MINIMIZE);
- WindowState := W.WindowState;
- if WindowState = wsNormal then
- begin
// set default (screen center)
- SetBounds((Screen.Width - Width) div 2, (Screen.Height - Height) div 2, Width, Height);
- if BorderStyle in [bsSizeable, bsSizeToolWin] then
- BoundsRect := W.BoundsRect
- else
- begin
- Top := W.BoundsRect.Top;
- Left := W.BoundsRect.Left;
- end;
+ SetBounds((Screen.Width - Width) div 2, (Screen.Height - Height) div 2, Width, Height);
+ if BorderStyle in [bsSizeable, bsSizeToolWin] then
+ BoundsRect := W.BoundsRect
+ else
+ begin
+ Top := W.BoundsRect.Top;
+ Left := W.BoundsRect.Left;
end;
end;
end;
@@ -101,14 +98,12 @@
var
W: TAppWindowInfo;
begin
- if GlobalAppOptions.SaveFormPos then
- begin
- W.Name := self.Name;
- W.WindowState := WindowState;
- W.BoundsRect := BoundsRect;
- GlobalAppOptions.WindowInfos[self] := W;
- end;
+ W.Name := self.Name;
+ W.WindowState := WindowState;
+ W.BoundsRect := BoundsRect;
+ GlobalAppOptions.WindowInfos[self] := W;
inherited;
end;
end.
+
Modified: translator/trunk/src/MainFrm.pas
===================================================================
--- translator/trunk/src/MainFrm.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/MainFrm.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -4387,6 +4387,8 @@
lvTranslateStrings.ItemIndex := FTranslateFile.Items.IndexOf(Value)
else
lvTranslateStrings.ItemIndex := -1;
+ if lvTranslateStrings.Selected <> nil then
+ lvTranslateStrings.Selected.MakeVisible(false);
end;
function TfrmMain.GetSelectedListItem: TTntListItem;
Modified: translator/trunk/src/ToolConsistency/ToolConsistency.dpr
===================================================================
--- translator/trunk/src/ToolConsistency/ToolConsistency.dpr 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/ToolConsistency/ToolConsistency.dpr 2006-12-09 14:19:19 UTC (rev 175)
@@ -37,3 +37,4 @@
begin
end.
+
Added: translator/trunk/src/ToolConsistency/ToolConsistencyConsts.pas
===================================================================
--- translator/trunk/src/ToolConsistency/ToolConsistencyConsts.pas (rev 0)
+++ translator/trunk/src/ToolConsistency/ToolConsistencyConsts.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -0,0 +1,41 @@
+{@abstract(Resourcestrings for ToolConsistency) }
+{
+ Copyright \xA9 2006 by Alexander Kornienko; all rights reserved
+
+ Developer(s):
+ Korney San - kora att users dott sourceforge dott net
+
+ Status:
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html
+
+ Software distributed under the License is distributed on an "AS IS" basis,
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ the specific language governing rights and limitations under the License.
+}
+// $Id$
+unit ToolConsistencyConsts;
+
+interface
+const
+ SLocalizeSectionName = 'TToolConsistency';
+ SToolConsistencyAbout = 'This plugin checks and displays inconsistent translations';
+ SToolConsistencyPluginDisplayName = 'Check translation consistency...';
+ SToolConsistencyFormCaption = 'Consistency Checker';
+ SToolConsistencyLabel1 = '&Inconsistent items:';
+ SToolConsistencytvItemsHint = 'Press F2 to edit an item';
+ SToolConsistencybtnClose = '&Close';
+ SToolConsistencybtnCloseHint = 'Close this form';
+ SToolConsistencybtnUpdate = '&Update';
+ SToolConsistencybtnUpdateHint = 'Update the list';
+ SToolConsistencychkIgnoreAccelChar = 'Ignore accelerator &key';
+ SToolConsistencychkIgnoreAccelCharHint = 'Include/exclude accelerator key when displaying original items';
+ SToolConsistencyUsethistranslation1 = 'Use &this translation';
+ SToolConsistencyUsethistranslation1Hint = 'Use this translation for all items';
+ SToolConsistencyEdit1 = 'Edit';
+ SToolConsistencyEdit1Hint = 'Edit current item';
+ SToolConsistencyIsConsistent = 'Congratulations! - No inconsistent items found!';
+implementation
+
+end.
Property changes on: translator/trunk/src/ToolConsistency/ToolConsistencyConsts.pas
___________________________________________________________________
Name: svn:keywords
+ LastChangedDate
LastChangedRevision
LastChangedBy
HeadURL
Id
Modified: translator/trunk/src/ToolConsistency/ToolConsistencyFrm.dfm
===================================================================
--- translator/trunk/src/ToolConsistency/ToolConsistencyFrm.dfm 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/ToolConsistency/ToolConsistencyFrm.dfm 2006-12-09 14:19:19 UTC (rev 175)
@@ -2,7 +2,7 @@
Left = 436
Top = 264
Width = 402
- Height = 235
+ Height = 244
ActiveControl = tvItems
Caption = 'Consistency Checker'
Color = clBtnFace
@@ -131,7 +131,7 @@
ShowHint = True
DesignSize = (
394
- 201)
+ 210)
PixelsPerInch = 96
TextHeight = 13
object lblInfo: TTntLabel
@@ -158,68 +158,63 @@
FocusControl = tvItems
end
object chkIgnoreAccelChar: TTntCheckBox
- Left = 13
- Top = 166
- Width = 190
+ Left = 16
+ Top = 171
+ Width = 134
Height = 17
Hint = 'Include/exclude accelerator key when displaying original items'
Anchors = [akLeft, akBottom]
Caption = 'Ignore accelerator &key'
- Checked = True
- State = cbChecked
- TabOrder = 2
+ TabOrder = 1
OnClick = chkIgnoreAccelCharClick
end
object tvItems: TTntTreeView
Left = 7
Top = 25
Width = 378
- Height = 116
- Hint = 'Press F2 to edit an item'
+ Height = 141
+ Hint = 'Press F2 to edit an item. Double click to synch with main list.'
Anchors = [akLeft, akTop, akRight, akBottom]
- BevelInner = bvNone
BevelKind = bkFlat
BorderStyle = bsNone
ChangeDelay = 60
HideSelection = False
Indent = 19
PopupMenu = popItems
- ShowButtons = False
TabOrder = 0
OnChange = tvItemsChange
+ OnDblClick = tvItemsDblClick
OnEdited = tvItemsEdited
OnEditing = tvItemsEditing
end
object btnClose: TTntButton
Left = 307
- Top = 163
+ Top = 175
Width = 75
Height = 25
Action = acClose
Anchors = [akRight, akBottom]
Cancel = True
- TabOrder = 4
+ TabOrder = 3
end
object btnUpdate: TTntButton
Left = 223
- Top = 163
+ Top = 175
Width = 75
Height = 25
Action = acUpdate
Anchors = [akRight, akBottom]
- TabOrder = 3
+ TabOrder = 2
end
- object chkAutoAccelChar: TTntCheckBox
- Left = 13
- Top = 145
- Width = 365
+ object chkSynchronizeAccelChar: TTntCheckBox
+ Left = 16
+ Top = 188
+ Width = 201
Height = 17
- Hint = 'Include/exclude accelerator key when displaying original items'
+ Hint = 'Automatically insert missing accelerator key when editing.'
Anchors = [akLeft, akBottom]
- Caption = 'Insert &accelerator key on edit'
- Checked = True
- State = cbChecked
- TabOrder = 1
+ Caption = 'Synchronize accelerator with &original'
+ TabOrder = 4
end
object alMain: TTntActionList
OnUpdate = alMainUpdate
@@ -255,6 +250,7 @@
Top = 56
object Usethistranslation1: TTntMenuItem
Action = acUseThisTranslation
+ Hint = 'Use this translation for all items'
end
object Edit1: TTntMenuItem
Action = acEdit
Modified: translator/trunk/src/ToolConsistency/ToolConsistencyFrm.pas
===================================================================
--- translator/trunk/src/ToolConsistency/ToolConsistencyFrm.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/ToolConsistency/ToolConsistencyFrm.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -1,3 +1,22 @@
+{@abstract(Edit form for ToolConsistency) }
+{
+ Copyright \xA9 2003-2006 by Peter Thornqvist; all rights reserved
+
+ Developer(s):
+ p3 - peter3 att users dott sourceforge dott net
+ Korney San - kora att users dott sourceforge dott net
+
+ Status:
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html
+
+ Software distributed under the License is distributed on an "AS IS" basis,
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ the specific language governing rights and limitations under the License.
+}
+// $Id$
+
unit ToolConsistencyFrm;
interface
@@ -23,7 +42,7 @@
popItems: TTntPopupMenu;
Usethistranslation1: TTntMenuItem;
Edit1: TTntMenuItem;
- chkAutoAccelChar: TTntCheckBox;
+ chkSynchronizeAccelChar: TTntCheckBox;
procedure chkIgnoreAccelCharClick(Sender: TObject);
procedure tvItemsChange(Sender: TObject; Node: TTreeNode);
procedure tvItemsEditing(Sender: TObject; Node: TTreeNode;
@@ -35,14 +54,19 @@
procedure acCloseExecute(Sender: TObject);
procedure acUpdateExecute(Sender: TObject);
procedure alMainUpdate(Action: TBasicAction; var Handled: Boolean);
+ procedure tvItemsDblClick(Sender: TObject);
private
{ Private declarations }
+ Congratulations: WideString;
FItems: ITranslationItems;
+ FAppServices: IApplicationServices;
FSelectedItem: ITranslationItem;
procedure BuildList(IgnoreAccelChar: boolean);
procedure LoadSettings;
procedure SaveSettings;
+ function AutoShortCut(const Item: ITranslationItem;
+ S: WideString): WideString;
public
{ Public declarations }
@@ -53,9 +77,11 @@
implementation
uses
- WideIniFiles, TntWideStrUtils, StrUtils;
+ ToolConsistencyConsts,
+ WideIniFiles;
{$R *.dfm}
+
type
TTranslationItems = class
private
@@ -141,7 +167,6 @@
Result := TTntStrings(FOriginalItems.Objects[Index]);
end;
-
function TTranslationItems.GetName(Index: integer): WideString;
begin
Result := FOriginalItems[Index];
@@ -154,6 +179,30 @@
{ TfrmToolConsistency }
+function TfrmToolConsistency.AutoShortCut(const Item: ITranslationItem; S: WideString): WideString;
+begin
+ if (Item <> nil) then
+ begin
+ // Synchronize accelerator
+ if chkSynchronizeAccelChar.Checked then
+ begin
+ if WideGetHotkey(Item.Original) = '' then
+ begin
+ //No accelerator in original
+ S := WideStripHotkey(S);
+ end
+ else
+ begin
+ // Accelerator in original
+ if WideGetHotkey(S) = '' then
+ S := cHotkeyPrefix + S;
+ end;
+ end;
+ Item.Translation := S;
+ end;
+ Result := S;
+end;
+
procedure TfrmToolConsistency.chkIgnoreAccelCharClick(Sender: TObject);
begin
BuildList(chkIgnoreAccelChar.Checked);
@@ -190,7 +239,7 @@
begin
// no items in tree -> translation is consistent
tvItems.ShowRoot := false;
- tvItems.Items.Add(nil, 'Congratulations! - No inconsistent items found!');
+ tvItems.Items.Add(nil, Congratulations);
end
else
tvItems.ShowRoot := true;
@@ -205,12 +254,32 @@
class function TfrmToolConsistency.Execute(const ApplicationServices: IApplicationServices; const Items, Orphans: ITranslationItems; var SelectedItem: ITranslationItem): boolean;
var
frm: TfrmToolConsistency;
- FAppHandle:Cardinal;
+ FAppHandle: Cardinal;
begin
FAppHandle := Application.Handle;
Application.Handle := ApplicationServices.AppHandle;
frm := self.Create(Application);
try
+ if ApplicationServices <> nil then
+ begin
+ frm.FAppServices := ApplicationServices;
+ frm.Caption := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencyFormCaption, SToolConsistencyFormCaption);
+ frm.TntLabel1.Caption := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencyLabel1, SToolConsistencyLabel1);
+ frm.tvItems.Hint := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencytvItemsHint, SToolConsistencytvItemsHint);
+ frm.btnClose.Caption := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencybtnClose, SToolConsistencybtnClose);
+ frm.btnClose.Hint := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencybtnCloseHint, SToolConsistencybtnCloseHint);
+ frm.btnUpdate.Caption := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencybtnUpdate, SToolConsistencybtnUpdate);
+ frm.btnUpdate.Hint := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencybtnUpdateHint, SToolConsistencybtnUpdateHint);
+ frm.chkIgnoreAccelChar.Caption := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencychkIgnoreAccelChar, SToolConsistencychkIgnoreAccelChar);
+ frm.chkIgnoreAccelChar.Hint := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencychkIgnoreAccelCharHint, SToolConsistencychkIgnoreAccelCharHint);
+ frm.Usethistranslation1.Caption := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencyUsethistranslation1, SToolConsistencyUsethistranslation1);
+ frm.Usethistranslation1.Hint := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencyUsethistranslation1Hint, SToolConsistencyUsethistranslation1Hint);
+ frm.Edit1.Caption := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencyEdit1, SToolConsistencyEdit1);
+ frm.Edit1.Hint := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencyEdit1Hint, SToolConsistencyEdit1Hint);
+ frm.Congratulations := ApplicationServices.Translate(SLocalizeSectionName, SToolConsistencyIsConsistent, SToolConsistencyIsConsistent);
+ end
+ else
+ frm.Congratulations := SToolConsistencyIsConsistent;
frm.FItems := Items;
frm.FSelectedItem := SelectedItem;
frm.LoadSettings;
@@ -230,19 +299,19 @@
with TWideMemIniFile.Create(ChangeFileExt(GetModuleName(HInstance), '.ini')) do
try
chkIgnoreAccelChar.Checked := ReadBool('Settings', 'IgnoreAccelChar', chkIgnoreAccelChar.Checked);
- chkAutoAccelChar.Checked := ReadBool('Settings', 'InsertAccelChar', chkAutoAccelChar.Checked);
+ chkSynchronizeAccelChar.Checked := ReadBool('Settings', 'SyncAccelChar', chkSynchronizeAccelChar.Checked);
+
finally
Free;
end;
end;
-
procedure TfrmToolConsistency.SaveSettings;
begin
with TWideMemIniFile.Create(ChangeFileExt(GetModuleName(HInstance), '.ini')) do
try
WriteBool('Settings', 'IgnoreAccelChar', chkIgnoreAccelChar.Checked);
- WriteBool('Settings', 'InsertAccelChar', chkAutoAccelChar.Checked);
+ WriteBool('Settings', 'SyncAccelChar', chkSynchronizeAccelChar.Checked);
UpdateFile;
finally
Free;
@@ -271,18 +340,8 @@
procedure TfrmToolConsistency.tvItemsEdited(Sender: TObject;
Node: TTntTreeNode; var S: WideString);
- function DoAutoAccelChar(var S:WideString):WideString;
- begin
- Result := S;
- if chkAutoAccelChar.Checked and AnsiContainsText(FSelectedItem.Original, '&')
- and not AnsiContainsText(S, '&') then
- Result := '&' + S;
- S := Result;
- end;
begin
- FSelectedItem := ITranslationItem(Node.Data);
- if FSelectedItem <> nil then
- FSelectedItem.Translation := DoAutoAccelChar(S);
+ S := AutoShortCut(ITranslationItem(Node.Data), S);
end;
procedure TfrmToolConsistency.acUseThisTranslationExecute(Sender: TObject);
@@ -298,9 +357,9 @@
N := N.getPrevSibling;
while N <> nil do
begin
- Caption := 'N.getPrevSibling';
+ // Caption := 'N.getPrevSibling';
Item2 := ITranslationItem(N.Data);
- Item2.Translation := Item1.Translation;
+ Item2.Translation := AutoShortCut(Item2, Item1.Translation);
Item2.Translated := Item2.Translation <> '';
N.Text := Item2.Translation;
N := N.getPrevSibling;
@@ -311,9 +370,9 @@
N := N.getNextSibling;
while N <> nil do
begin
- Caption := 'N.getNextSibling';
+ // Caption := 'N.getNextSibling';
Item2 := ITranslationItem(N.Data);
- Item2.Translation := Item1.Translation;
+ Item2.Translation := AutoShortCut(Item2, Item1.Translation);
Item2.Translated := Item2.Translation <> '';
N.Text := Item2.Translation;
N := N.getNextSibling;
@@ -347,5 +406,11 @@
acEdit.Enabled := acUseThisTranslation.Enabled;
end;
+procedure TfrmToolConsistency.tvItemsDblClick(Sender: TObject);
+begin
+ if Assigned(tvItems.Selected) and Assigned(tvItems.Selected.Data) then
+ FAppServices.SelectedItem := ITranslationItem(tvItems.Selected.Data);
+end;
+
end.
Modified: translator/trunk/src/ToolConsistency/ToolConsistencyImpl.pas
===================================================================
--- translator/trunk/src/ToolConsistency/ToolConsistencyImpl.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/ToolConsistency/ToolConsistencyImpl.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -4,6 +4,7 @@
Developer(s):
p3 - peter3 att users dott sourceforge dott net
+ Korney San - kora att users dott sourceforge dott net
Status:
The contents of this file are subject to the Mozilla Public License Version
@@ -16,6 +17,7 @@
}
// $Id$
+
unit ToolConsistencyImpl;
interface
@@ -29,9 +31,13 @@
safecall;
end;
- TToolConsistencyPlugin = class(TInterfacedObject, IInterface, IToolItem)
+ TToolConsistencyPlugin = class(TInterfacedObject, IInterface, IToolItem, ILocalizable)
private
+ FStringIndex: integer;
FAppServices:IApplicationServices;
+ function Translate(const Value: WideString): WideString;
+ { ILocalizable }
+ function GetString(out Section: WideString; out Name: WideString; out Value: WideString): WordBool; safecall;
public
function About: WideString; safecall;
function DisplayName: WideString; safecall;
@@ -43,7 +49,7 @@
implementation
-uses ToolConsistencyFrm;
+uses ToolConsistencyFrm, ToolConsistencyConsts;
{ TToolConsistencyPlugins }
@@ -66,14 +72,66 @@
{ TToolConsistencyPlugin }
+function TToolConsistencyPlugin.Translate(const Value: WideString): WideString;
+begin
+ if FAppServices <> nil then
+ Result := FAppServices.Translate(SLocalizeSectionName, Value, Value)
+ else
+ Result := Value;
+end;
+
+function TToolConsistencyPlugin.GetString(out Section, Name, Value: WideString): WordBool;
+begin
+ Section := SLocalizeSectionName;
+ Result := true;
+ case FStringIndex of
+ 0:
+ Name := SToolConsistencyAbout;
+ 1:
+ Name := SToolConsistencyPluginDisplayName;
+ 2:
+ Name := SToolConsistencyFormCaption;
+ 3:
+ Name := SToolConsistencyLabel1;
+ 4:
+ Name := SToolConsistencybtnClose;
+ 5:
+ Name := SToolConsistencybtnCloseHint;
+ 6:
+ Name := SToolConsistencybtnUpdate;
+ 7:
+ Name := SToolConsistencybtnUpdateHint;
+ 8:
+ Name := SToolConsistencychkIgnoreAccelChar;
+ 9:
+ Name := SToolConsistencychkIgnoreAccelCharHint;
+ 10:
+ Name := SToolConsistencytvItemsHint;
+ 11:
+ Name := SToolConsistencyUsethistranslation1;
+ 12:
+ Name := SToolConsistencyUsethistranslation1Hint;
+ 13:
+ Name := SToolConsistencyEdit1;
+ 14:
+ Name := SToolConsistencyEdit1Hint;
+ 15:
+ Name := SToolConsistencyIsConsistent;
+ else
+ Result := false;
+ end;
+ Value := Name;
+ Inc(FStringIndex);
+end;
+
function TToolConsistencyPlugin.About: WideString;
begin
- Result := 'This plugin checks and displays inconsistent translations';
+ Result := Translate(SToolConsistencyAbout);
end;
function TToolConsistencyPlugin.DisplayName: WideString;
begin
- Result := 'Check translation consistency...';
+ Result := Translate(SToolConsistencyPluginDisplayName);
end;
function TToolConsistencyPlugin.Execute(const Items, Orphans: ITranslationItems; var SelectedItem: ITranslationItem): HRESULT;
@@ -101,3 +159,4 @@
end.
+
Modified: translator/trunk/src/TransIntf.pas
===================================================================
--- translator/trunk/src/TransIntf.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/TransIntf.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -235,6 +235,8 @@
procedure SetHeader(const Value: WideString);
function GetFooter: WideString;
procedure SetFooter(const Value: WideString);
+ function GetSelectedItem:ITranslationItem;
+ procedure SetSelectedItem(const Value:ITranslationItem);
function GetAppOption(const Section, Name, Default: WideString): WideString; safecall;
procedure SetAppOption(const Section, Name, Value: WideString); safecall;
@@ -246,10 +248,12 @@
property Items: ITranslationItems read GetItems;
property Orphans: ITranslationItems read GetOrphans;
+ property SelectedItem:ITranslationItem read GetSelectedItem write SetSelectedItem;
property Dictionary: IDictionaryItems read GetDictionaryItems;
property AppHandle: Cardinal read GetAppHandle;
property Header: WideString read GetHeader write SetHeader;
property Footer: WideString read GetFooter write SetFooter;
+
end;
// return S_OK if all is fine
Modified: translator/trunk/src/XilisoftPlugin/XiliSoftParserConsts.pas
===================================================================
--- translator/trunk/src/XilisoftPlugin/XiliSoftParserConsts.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/XilisoftPlugin/XiliSoftParserConsts.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -2,7 +2,7 @@
Copyright \xA9 2006 by Alexander Kornienko; all rights reserved
Developer(s):
- Korney San - karo att users dott sourceforge dott net
+ Korney San - kora att users dott sourceforge dott net
Status:
The contents of this file are subject to the Mozilla Public License Version
Modified: translator/trunk/src/XilisoftPlugin/XilisoftParser.dpr
===================================================================
--- translator/trunk/src/XilisoftPlugin/XilisoftParser.dpr 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/XilisoftPlugin/XilisoftParser.dpr 2006-12-09 14:19:19 UTC (rev 175)
@@ -3,7 +3,7 @@
Copyright \xA9 2006 by Alexander Kornienko; all rights reserved
Developer(s):
- Korney San - karo att users dott sourceforge dott net
+ Korney San - kora att users dott sourceforge dott net
Status:
The contents of this file are subject to the Mozilla Public License Version
Modified: translator/trunk/src/XilisoftPlugin/XilisoftParser.res
===================================================================
(Binary files differ)
Modified: translator/trunk/src/XilisoftPlugin/XilisoftParserCfgForm.pas
===================================================================
--- translator/trunk/src/XilisoftPlugin/XilisoftParserCfgForm.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/XilisoftPlugin/XilisoftParserCfgForm.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -2,7 +2,7 @@
Copyright \xA9 2006 by Alexander Kornienko; all rights reserved
Developer(s):
- Korney San - karo att users dott sourceforge dott net
+ Korney San - kora att users dott sourceforge dott net
Status:
The contents of this file are subject to the Mozilla Public License Version
Modified: translator/trunk/src/XilisoftPlugin/XilisoftParserImpl.pas
===================================================================
--- translator/trunk/src/XilisoftPlugin/XilisoftParserImpl.pas 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/XilisoftPlugin/XilisoftParserImpl.pas 2006-12-09 14:19:19 UTC (rev 175)
@@ -3,7 +3,7 @@
Copyright \xA9 2006 by Alexander Kornienko; all rights reserved
Developer(s):
- Korney San - karo att users dott sourceforge dott net
+ Korney San - kora att users dott sourceforge dott net
Status:
The contents of this file are subject to the Mozilla Public License Version
Modified: translator/trunk/src/translator.dof
===================================================================
--- translator/trunk/src/translator.dof 2006-12-09 13:12:39 UTC (rev 174)
+++ translator/trunk/src/translator.dof 2006-12-09 14:19:19 UTC (rev 175)
@@ -1,6 +1,81 @@
[FileVersion]
Version=7.0
[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=1
+P=1
+Q=0
+R=0
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+NamespacePrefix=
+SymbolDeprecated=1
+SymbolLibrary=1
+SymbolPlatform=1
+UnitLibrary=1
+UnitPlatform=1
+UnitDeprecated=1
+HResultCompat=1
+HidingMember=1
+HiddenVirtual=1
+Garbage=1
+BoundsError=1
+ZeroNilCompat=1
+StringConstTruncated=1
+ForLoopVarVarPar=1
+TypedConstVarPar=1
+AsgToTypedConst=1
+CaseLabelRange=1
+ForVariable=1
+ConstructingAbstract=1
+ComparisonFalse=1
+ComparisonTrue=1
+ComparingSignedUnsigned=1
+CombiningSignedUnsigned=1
+UnsupportedConstruct=1
+FileOpen=1
+FileOpenUnitSrc=1
+BadGlobalSymbol=1
+DuplicateConstructorDestructor=1
+InvalidDirective=1
+PackageNoLink=1
+PackageThreadVar=1
+ImplicitImport=1
+HPPEMITIgnored=1
+NoRetVal=1
+UseBeforeDef=1
+ForLoopVarUndef=1
+UnitNameMismatch=1
+NoCFGFileFound=1
+MessageDirective=1
+ImplicitVariants=1
+UnicodeToLocale=1
+LocaleToUnicode=1
+ImagebaseMultiple=1
+SuspiciousTypecast=1
+PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
@@ -20,6 +95,7 @@
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
+Packages=
Conditionals=USEOLDTBX
DebugSourceDirs=
UsePackages=0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|