FPCUnit: improved i18n, cleaned up unused resource strings

This commit is contained in:
Maxim Ganetsky 2023-11-20 03:59:32 +03:00
parent 3b6632f5c2
commit eaedb0019d
5 changed files with 85 additions and 100 deletions

View File

@ -199,7 +199,6 @@ var
resourcestring resourcestring
rsAllTests = 'All Tests'; rsAllTests = 'All Tests';
rsRun = 'Run ';
rsRuns = 'Runs: %s/%s'; rsRuns = 'Runs: %s/%s';
rsErrors = '%s Errors: %s'; rsErrors = '%s Errors: %s';
rsFailures = '%s Failures: %s'; rsFailures = '%s Failures: %s';
@ -207,16 +206,10 @@ resourcestring
rsException = 'Exception: %s'; rsException = 'Exception: %s';
rsExceptionMes = 'Exception message: %s'; rsExceptionMes = 'Exception message: %s';
rsExceptionCla = 'Exception class: %s'; rsExceptionCla = 'Exception class: %s';
rsUnitName = 'Unit name: %s';
rsMethodName = 'Method name: %s';
rsLineNumber = 'Line number: %s';
rsRunning = 'Running %s'; rsRunning = 'Running %s';
rsNumberOfExec = 'Number of executed tests: %s Time elapsed: %s'; rsNumberOfExec = 'Number of executed tests: %s Time elapsed: %s';
// Visual components captions // Visual components captions
sfrmGUITest = 'FPCUnit - run unit test'; sfrmGUITest = 'FPCUnit - run unit test';
sbtnRun = 'Run';
sbtnRunH = 'Run highlighted test';
sbtnClose = 'Close';
stshTree = 'Testcase tree'; stshTree = 'Testcase tree';
stshResults = 'Results XML'; stshResults = 'Results XML';
sactRunAction = '&Run all'; sactRunAction = '&Run all';

View File

@ -17,8 +17,8 @@ uses
LazFileCache, LazFileUtils, LazStringUtils, FileUtil, LazFileCache, LazFileUtils, LazStringUtils, FileUtil,
// IdeIntf // IdeIntf
IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, IDEDialogs, IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, IDEDialogs,
// Pas2Js // FPCUnit
TestInsightController; TestInsightController, strtestcaseopts;
Type Type
{ TTestInsightOptionsFrame } { TTestInsightOptionsFrame }
@ -48,7 +48,7 @@ implementation
function TTestInsightOptionsFrame.GetTitle: String; function TTestInsightOptionsFrame.GetTitle: String;
begin begin
Result:='Testinsight'; Result := rsTestInsightTitle;
end; end;
procedure TTestInsightOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog); procedure TTestInsightOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
@ -58,6 +58,10 @@ begin
seServerPort.Value:=DefaultPort; seServerPort.Value:=DefaultPort;
cbServerBasePath.Items.Add(DefaultBasePath); cbServerBasePath.Items.Add(DefaultBasePath);
cbServerBasePath.ItemIndex:=0; cbServerBasePath.ItemIndex:=0;
lblServerPort.Caption:=rsServerPort;
lblBaseURL.Caption:=rsServerPath;
cbAutoFetch.Caption:=rsAutomaticallyFetchTestListOnOpen;
end; end;
procedure TTestInsightOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); procedure TTestInsightOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);

View File

@ -1,13 +1,14 @@
object TestInsightForm: TTestInsightForm object TestInsightForm: TTestInsightForm
Left = 484 Left = 484
Height = 356 Height = 445
Top = 167 Top = 167
Width = 660 Width = 825
Caption = 'Test insight' Caption = 'Test insight'
ClientHeight = 356 ClientHeight = 445
ClientWidth = 660 ClientWidth = 825
Constraints.MinHeight = 200 Constraints.MinHeight = 250
Constraints.MinWidth = 250 Constraints.MinWidth = 312
DesignTimePPI = 120
Icon.Data = { Icon.Data = {
F6030000000001000100100E000001002000E003000016000000280000001000 F6030000000001000100100E000001002000E003000016000000280000001000
00001C0000000100200000000000800300006400000064000000000000000000 00001C0000000100200000000000800300006400000064000000000000000000
@ -45,21 +46,19 @@ object TestInsightForm: TTestInsightForm
Menu = MMtestInsight Menu = MMtestInsight
Position = poScreenCenter Position = poScreenCenter
ShowHint = True ShowHint = True
LCLVersion = '3.99.0.0'
OnClose = FormClose OnClose = FormClose
OnCreate = TestInsightFormCreate OnCreate = TestInsightFormCreate
OnDestroy = TestInsightFormDestroy OnDestroy = TestInsightFormDestroy
OnShow = TestInsightFormShow
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 72 Height = 90
Top = 0 Top = 0
Width = 660 Width = 825
Align = alTop Align = alTop
ClientHeight = 72 ClientHeight = 90
ClientWidth = 660 ClientWidth = 825
Constraints.MinHeight = 50 Constraints.MinHeight = 62
Constraints.MinWidth = 450 Constraints.MinWidth = 562
FullRepaint = False FullRepaint = False
ParentColor = False ParentColor = False
TabOrder = 0 TabOrder = 0
@ -69,33 +68,33 @@ object TestInsightForm: TTestInsightForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Panel1 AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 7 Left = 9
Height = 24 Height = 30
Top = 40 Top = 50
Width = 646 Width = 807
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6 BorderSpacing.Around = 8
OnPaint = pbBarPaint OnPaint = pbBarPaint
end end
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 1 Left = 1
Height = 29 Height = 35
Top = 1 Top = 1
Width = 658 Width = 823
AutoSize = True AutoSize = True
ButtonHeight = 25 ButtonHeight = 31
ButtonWidth = 25 ButtonWidth = 31
Caption = 'ToolBar1' Caption = 'ToolBar1'
EdgeBorders = [ebTop, ebBottom] EdgeBorders = [ebTop, ebBottom]
Images = ILMenu Images = ILMenu
TabOrder = 0 TabOrder = 0
object ToolButton1: TToolButton object ToolButton1: TToolButton
Left = 35 Left = 42
Top = 2 Top = 2
Action = actRunAll Action = actRunAll
end end
object ToolButton2: TToolButton object ToolButton2: TToolButton
Left = 61 Left = 73
Top = 2 Top = 2
Action = ActRunHighlightedTest Action = ActRunHighlightedTest
Caption = 'Run selected' Caption = 'Run selected'
@ -106,26 +105,26 @@ object TestInsightForm: TTestInsightForm
Action = aRefresh Action = aRefresh
end end
object ToolButton4: TToolButton object ToolButton4: TToolButton
Left = 27 Left = 32
Height = 25 Height = 31
Top = 2 Top = 2
Caption = 'ToolButton4' Caption = 'ToolButton4'
Style = tbsSeparator Style = tbsSeparator
end end
object ToolButton5: TToolButton object ToolButton5: TToolButton
Left = 87 Left = 104
Height = 25 Height = 31
Top = 2 Top = 2
Caption = 'ToolButton5' Caption = 'ToolButton5'
Style = tbsSeparator Style = tbsSeparator
end end
object ToolButton6: TToolButton object ToolButton6: TToolButton
Left = 95 Left = 114
Top = 2 Top = 2
Action = actPrevError Action = actPrevError
end end
object ToolButton7: TToolButton object ToolButton7: TToolButton
Left = 121 Left = 145
Top = 2 Top = 2
Action = actNextError Action = actNextError
end end
@ -133,24 +132,24 @@ object TestInsightForm: TTestInsightForm
end end
object Panel2: TPanel object Panel2: TPanel
Left = 0 Left = 0
Height = 266 Height = 326
Top = 72 Top = 90
Width = 660 Width = 825
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
Caption = 'Panel2' Caption = 'Panel2'
ClientHeight = 266 ClientHeight = 326
ClientWidth = 660 ClientWidth = 825
FullRepaint = False FullRepaint = False
TabOrder = 1 TabOrder = 1
TabStop = True TabStop = True
object TestTree: TTreeView object TestTree: TTreeView
Left = 0 Left = 0
Height = 166 Height = 201
Top = 3 Top = 4
Width = 660 Width = 825
Align = alClient Align = alClient
BorderSpacing.Top = 3 BorderSpacing.Top = 4
BackgroundColor = clBtnFace BackgroundColor = clBtnFace
Color = clBtnFace Color = clBtnFace
Images = TestTreeImageList Images = TestTreeImageList
@ -169,9 +168,9 @@ object TestInsightForm: TTestInsightForm
end end
object mDetails: TMemo object mDetails: TMemo
Left = 0 Left = 0
Height = 97 Height = 121
Top = 169 Top = 205
Width = 660 Width = 825
Align = alBottom Align = alBottom
PopupMenu = pmDetails PopupMenu = pmDetails
ReadOnly = True ReadOnly = True
@ -181,14 +180,14 @@ object TestInsightForm: TTestInsightForm
end end
object sbTestInsight: TStatusBar object sbTestInsight: TStatusBar
Left = 0 Left = 0
Height = 18 Height = 29
Top = 338 Top = 416
Width = 660 Width = 825
Panels = <> Panels = <>
end end
object TestTreeImageList: TImageList object TestTreeImageList: TImageList
Left = 80 Left = 100
Top = 200 Top = 250
Bitmap = { Bitmap = {
4C7A0E0000001000000010000000ED1400000000000078DAED9A075495D7B2C7 4C7A0E0000001000000010000000ED1400000000000078DAED9A075495D7B2C7
8F8AD84050B080318ADDDCABA2891ACD3596144D54124BD45863305E3556EC89 8F8AD84050B080318ADDDCABA2891ACD3596144D54124BD45863305E3556EC89
@ -364,8 +363,8 @@ object TestInsightForm: TTestInsightForm
object ILMenu: TImageList object ILMenu: TImageList
Height = 22 Height = 22
Width = 22 Width = 22
Left = 264 Left = 330
Top = 184 Top = 230
Bitmap = { Bitmap = {
4C7A090000001600000016000000161700000000000078DAE59A075454C9B686 4C7A090000001600000016000000161700000000000078DAE59A075454C9B686
8BD40262C000624431678C9873161D73761C75F48ECEE89DD1318C09EEA88880 8BD40262C000624431678C9873161D73761C75F48ECEE89DD1318C09EEA88880
@ -556,16 +555,16 @@ object TestInsightForm: TTestInsightForm
} }
end end
object pmDetails: TPopupMenu object pmDetails: TPopupMenu
Left = 448 Left = 560
Top = 240 Top = 300
object MenuItemCopyText: TMenuItem object MenuItemCopyText: TMenuItem
Action = ActCopyTextToClipboard Action = ActCopyTextToClipboard
end end
end end
object alTestInsight: TActionList object alTestInsight: TActionList
Images = ILMenu Images = ILMenu
Left = 264 Left = 330
Top = 128 Top = 160
object actRunAll: TAction object actRunAll: TAction
Category = 'Run' Category = 'Run'
Caption = '&Run all' Caption = '&Run all'
@ -590,7 +589,7 @@ object TestInsightForm: TTestInsightForm
end end
object ActCopyErrorMsg: TAction object ActCopyErrorMsg: TAction
Category = 'Edit' Category = 'Edit'
Caption = 'actCopyErrorMsg' Caption = 'Copy message to clipboard'
ImageIndex = 0 ImageIndex = 0
OnExecute = ActCopyErrorMsgExecute OnExecute = ActCopyErrorMsgExecute
OnUpdate = ActCopyErrorMsgUpdate OnUpdate = ActCopyErrorMsgUpdate
@ -656,8 +655,8 @@ object TestInsightForm: TTestInsightForm
end end
object pmResults: TPopupMenu object pmResults: TPopupMenu
Images = ILMenu Images = ILMenu
Left = 448 Left = 560
Top = 288 Top = 360
object miCollapseNodes: TMenuItem object miCollapseNodes: TMenuItem
Caption = 'Collapse Nodes' Caption = 'Collapse Nodes'
OnClick = miCollapseNodesClick OnClick = miCollapseNodesClick
@ -701,13 +700,12 @@ object TestInsightForm: TTestInsightForm
end end
object miShowfailureMsg: TMenuItem object miShowfailureMsg: TMenuItem
Action = ActCopyErrorMsg Action = ActCopyErrorMsg
Caption = 'Copy message to clipboard'
OnClick = ActCopyErrorMsgExecute OnClick = ActCopyErrorMsgExecute
end end
end end
object ilNodeStates: TImageList object ilNodeStates: TImageList
Left = 80 Left = 100
Top = 272 Top = 340
Bitmap = { Bitmap = {
4C7A020000001000000010000000520000000000000078DAFBFF9F7CC0000450 4C7A020000001000000010000000520000000000000078DAFBFF9F7CC0000450
9A644C0BFD44BA7954FFA8FE41957E29C97F9482FFA3F99F28FD487A48D68FA6 9A644C0BFD44BA7954FFA8FE41957E29C97F9482FFA3F99F28FD487A48D68FA6
@ -717,8 +715,8 @@ object TestInsightForm: TTestInsightForm
end end
object MMtestInsight: TMainMenu object MMtestInsight: TMainMenu
Images = ILMenu Images = ILMenu
Left = 448 Left = 560
Top = 144 Top = 180
object MenuItemActions: TMenuItem object MenuItemActions: TMenuItem
Caption = 'Actions' Caption = 'Actions'
object MenuItem10: TMenuItem object MenuItem10: TMenuItem
@ -784,7 +782,7 @@ object TestInsightForm: TTestInsightForm
WindowWidth = 0 WindowWidth = 0
FillAttribute = 0 FillAttribute = 0
OnReadData = pTestReadData OnReadData = pTestReadData
Left = 74 Left = 93
Top = 127 Top = 159
end end
end end

View File

@ -87,14 +87,12 @@ type
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure pTestReadData(Sender: TObject); procedure pTestReadData(Sender: TObject);
procedure TestInsightFormCreate(Sender: TObject); procedure TestInsightFormCreate(Sender: TObject);
procedure TestInsightFormShow(Sender: TObject);
procedure TestInsightFormDestroy(Sender: TObject); procedure TestInsightFormDestroy(Sender: TObject);
procedure ActCheckAllExecute(Sender: TObject); procedure ActCheckAllExecute(Sender: TObject);
procedure ActCheckCurrentSuiteExecute(Sender: TObject); procedure ActCheckCurrentSuiteExecute(Sender: TObject);
procedure ActCloseFormExecute(Sender: TObject); procedure ActCloseFormExecute(Sender: TObject);
procedure ActCopyTextToClipboardExecute(Sender: TObject); procedure ActCopyTextToClipboardExecute(Sender: TObject);
procedure ActCopyTextToClipboardUpdate(Sender: TObject); procedure ActCopyTextToClipboardUpdate(Sender: TObject);
procedure ActSaveResultsExecute(Sender: TObject);
procedure ActRunHighlightedTestExecute(Sender: TObject); procedure ActRunHighlightedTestExecute(Sender: TObject);
procedure ActUncheckAllExecute(Sender: TObject); procedure ActUncheckAllExecute(Sender: TObject);
procedure ActRunHighLightedTestUpdate(Sender: TObject); procedure ActRunHighLightedTestUpdate(Sender: TObject);
@ -340,6 +338,11 @@ begin
MenuItemActions.Caption := smiActions; MenuItemActions.Caption := smiActions;
MenuItemTestTree.Caption := smiTestTree; MenuItemTestTree.Caption := smiTestTree;
MenuItemEdit.Caption := smiEdit; MenuItemEdit.Caption := smiEdit;
miCollapseNodes.Caption := smiCollapseNodes;
miExpandNodes.Caption := smiExpandNodes;
actNextError.Caption := rsNextError;
actPrevError.Caption := rsPreviousError;
ActCopyErrorMsg.Caption := sactCopyMessageToClipboard;
ActCopyTextToClipboard.Caption := sactCopyAllToClipboard; ActCopyTextToClipboard.Caption := sactCopyAllToClipboard;
ActCopyTextToClipboard.Hint := sactCopyAllToClipboardH; ActCopyTextToClipboard.Hint := sactCopyAllToClipboardH;
FServer:=CreateServer(Self); FServer:=CreateServer(Self);
@ -482,10 +485,6 @@ begin
TAction(Sender).Enabled := (ActiveControl = mDetails) ; TAction(Sender).Enabled := (ActiveControl = mDetails) ;
end; end;
procedure TTestInsightForm.ActSaveResultsExecute(Sender: TObject);
begin
end;
procedure TTestInsightForm.ActCheckAllExecute(Sender: TObject); procedure TTestInsightForm.ActCheckAllExecute(Sender: TObject);
var var
i: integer; i: integer;
@ -570,10 +569,6 @@ begin
TestTree.Selected.Expand(True); TestTree.Selected.Expand(True);
end; end;
procedure TTestInsightForm.TestInsightFormShow(Sender: TObject);
begin
end;
procedure TTestInsightForm.TestTreeChange(Sender: TObject; Node: TTreeNode); procedure TTestInsightForm.TestTreeChange(Sender: TObject; Node: TTreeNode);
begin begin
if not Assigned(Node) then if not Assigned(Node) then

View File

@ -27,15 +27,16 @@ resourcestring
sFPCUnConsoleTestDesc = 'An application to run FPCUnit test cases in console mode.'; sFPCUnConsoleTestDesc = 'An application to run FPCUnit test cases in console mode.';
sRunAllTests = '&Run all tests by default'; sRunAllTests = '&Run all tests by default';
sUseTextInsight = 'Use &testinsight to communicate results to the IDE'; sUseTextInsight = 'Use &Test Insight to communicate results to the IDE';
sSkipTimingInfo = '&Omit timing info in output';
sCreateFirstTestCase = '&Create first test case'; sCreateFirstTestCase = '&Create first test case';
sDefaultOutputFormat = 'Default output &format'; sDefaultOutputFormat = 'Default output &format';
rsTestInsightTitle = 'Test Insight'; rsTestInsightTitle = 'Test Insight';
rsServerPort = 'Server port';
rsServerPath = 'Server path';
rsAutomaticallyFetchTestListOnOpen = 'Automatically fetch test list on open';
rsAllTests = 'All Tests'; rsAllTests = 'All Tests';
rsRun = 'Run ';
rsRuns = 'Runs: %s/%s'; rsRuns = 'Runs: %s/%s';
rsErrors = '%s Errors: %s'; rsErrors = '%s Errors: %s';
rsFailures = '%s Failures: %s'; rsFailures = '%s Failures: %s';
@ -43,18 +44,8 @@ resourcestring
rsException = 'Exception: %s'; rsException = 'Exception: %s';
rsExceptionMes = 'Exception message: %s'; rsExceptionMes = 'Exception message: %s';
rsExceptionCla = 'Exception class: %s'; rsExceptionCla = 'Exception class: %s';
rsUnitName = 'Unit name: %s';
rsMethodName = 'Method name: %s';
rsLineNumber = 'Line number: %s';
rsRunning = 'Running %s';
rsNumberOfExec = 'Number of executed tests: %s Time elapsed: %s';
// Visual components captions // Visual components captions
sfrmGUITest = 'FPCUnit - run unit test'; sfrmGUITest = 'FPCUnit - run unit test';
sbtnRun = 'Run';
sbtnRunH = 'Run highlighted test';
sbtnClose = 'Close';
stshTree = 'Testcase tree';
stshResults = 'Results XML';
sactRunAction = '&Run all'; sactRunAction = '&Run all';
sactRunActionH = 'Run all checked tests'; sactRunActionH = 'Run all checked tests';
sactCloseForm = 'Quit'; sactCloseForm = 'Quit';
@ -68,14 +59,18 @@ resourcestring
smiActions = 'Actions'; smiActions = 'Actions';
smiTestTree = 'Test tree'; smiTestTree = 'Test tree';
smiEdit = 'Edit'; smiEdit = 'Edit';
smiCollapseNodes = 'Collapse Nodes';
smiExpandNodes = 'Expand Nodes';
rsNextError = 'Next error';
rsPreviousError = 'Previous error';
sactCopyAllToClipboard = 'Copy text to clipboard'; sactCopyAllToClipboard = 'Copy text to clipboard';
sactCopyMessageToClipboard = 'Copy message to clipboard';
sactCopyAllToClipboardH = 'Copy the entire text to clipboard'; sactCopyAllToClipboardH = 'Copy the entire text to clipboard';
sactSaveResults = 'Save results';
sactSaveResultsH = 'Save XML results to file';
SNoExecutableAvailable = 'Test executable is not available: "%s"'; SNoExecutableAvailable = 'Test executable is not available: "%s"';
SNoTestProjectConfigured = 'No test project configured.'; SNoTestProjectConfigured = 'No test project configured.';
SNavigationNotAvailable = 'Source navigation not available'; SNavigationNotAvailable = 'Source navigation not available.';
rsCouldNotDete = 'Could not determine class and method from test path "%s"'; rsCouldNotDete = 'Could not determine class and method from test path "%s"';
implementation implementation
end. end.