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
rsAllTests = 'All Tests';
rsRun = 'Run ';
rsRuns = 'Runs: %s/%s';
rsErrors = '%s Errors: %s';
rsFailures = '%s Failures: %s';
@ -207,16 +206,10 @@ resourcestring
rsException = 'Exception: %s';
rsExceptionMes = 'Exception message: %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
sfrmGUITest = 'FPCUnit - run unit test';
sbtnRun = 'Run';
sbtnRunH = 'Run highlighted test';
sbtnClose = 'Close';
stshTree = 'Testcase tree';
stshResults = 'Results XML';
sactRunAction = '&Run all';

View File

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

View File

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

View File

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

View File

@ -27,15 +27,16 @@ resourcestring
sFPCUnConsoleTestDesc = 'An application to run FPCUnit test cases in console mode.';
sRunAllTests = '&Run all tests by default';
sUseTextInsight = 'Use &testinsight to communicate results to the IDE';
sSkipTimingInfo = '&Omit timing info in output';
sUseTextInsight = 'Use &Test Insight to communicate results to the IDE';
sCreateFirstTestCase = '&Create first test case';
sDefaultOutputFormat = 'Default output &format';
rsTestInsightTitle = 'Test Insight';
rsServerPort = 'Server port';
rsServerPath = 'Server path';
rsAutomaticallyFetchTestListOnOpen = 'Automatically fetch test list on open';
rsAllTests = 'All Tests';
rsRun = 'Run ';
rsRuns = 'Runs: %s/%s';
rsErrors = '%s Errors: %s';
rsFailures = '%s Failures: %s';
@ -43,18 +44,8 @@ resourcestring
rsException = 'Exception: %s';
rsExceptionMes = 'Exception message: %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
sfrmGUITest = 'FPCUnit - run unit test';
sbtnRun = 'Run';
sbtnRunH = 'Run highlighted test';
sbtnClose = 'Close';
stshTree = 'Testcase tree';
stshResults = 'Results XML';
sactRunAction = '&Run all';
sactRunActionH = 'Run all checked tests';
sactCloseForm = 'Quit';
@ -68,14 +59,18 @@ resourcestring
smiActions = 'Actions';
smiTestTree = 'Test tree';
smiEdit = 'Edit';
smiCollapseNodes = 'Collapse Nodes';
smiExpandNodes = 'Expand Nodes';
rsNextError = 'Next error';
rsPreviousError = 'Previous error';
sactCopyAllToClipboard = 'Copy text to clipboard';
sactCopyMessageToClipboard = 'Copy message 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"';
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"';
implementation
end.