1
- using System ;
1
+ using System ;
2
2
using System . IO ;
3
3
using System . Linq ;
4
4
using System . Threading . Tasks ;
@@ -124,7 +124,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
124
124
}
125
125
catch ( Exception ex )
126
126
{
127
- Context . API . ShowMsgBox ( ex . Message , Context . API . GetTranslation ( " plugin_explorer_opendir_error" ) ) ;
127
+ Context . API . ShowMsgBox ( ex . Message , Localize . plugin_explorer_opendir_error ( ) ) ;
128
128
return false ;
129
129
}
130
130
}
@@ -138,7 +138,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
138
138
}
139
139
catch ( Exception ex )
140
140
{
141
- Context . API . ShowMsgBox ( ex . Message , Context . API . GetTranslation ( " plugin_explorer_opendir_error" ) ) ;
141
+ Context . API . ShowMsgBox ( ex . Message , Localize . plugin_explorer_opendir_error ( ) ) ;
142
142
return false ;
143
143
}
144
144
}
@@ -153,7 +153,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
153
153
}
154
154
catch ( Exception ex )
155
155
{
156
- Context . API . ShowMsgBox ( ex . Message , Context . API . GetTranslation ( " plugin_explorer_opendir_error" ) ) ;
156
+ Context . API . ShowMsgBox ( ex . Message , Localize . plugin_explorer_opendir_error ( ) ) ;
157
157
return false ;
158
158
}
159
159
}
@@ -166,7 +166,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
166
166
return false ;
167
167
} ,
168
168
Score = score ,
169
- TitleToolTip = Main . Context . API . GetTranslation ( " plugin_explorer_plugin_ToolTipOpenDirectory" ) ,
169
+ TitleToolTip = Localize . plugin_explorer_plugin_ToolTipOpenDirectory ( ) ,
170
170
SubTitleToolTip = Settings . DisplayMoreInformationInToolTip ? GetFolderMoreInfoTooltip ( path ) : path ,
171
171
ContextData = new SearchResult { Type = ResultType . Folder , FullPath = path , WindowsIndexed = windowsIndexed }
172
172
} ;
@@ -190,7 +190,7 @@ private static Result CreateDriveSpaceDisplayResult(string path, string actionKe
190
190
DriveInfo drv = new DriveInfo ( driveLetter ) ;
191
191
var freespace = ToReadableSize ( drv . AvailableFreeSpace , 2 ) ;
192
192
var totalspace = ToReadableSize ( drv . TotalSize , 2 ) ;
193
- var subtitle = string . Format ( Context . API . GetTranslation ( " plugin_explorer_diskfreespace" ) , freespace , totalspace ) ;
193
+ var subtitle = Localize . plugin_explorer_diskfreespace ( freespace , totalspace ) ;
194
194
double usingSize = ( Convert . ToDouble ( drv . TotalSize ) - Convert . ToDouble ( drv . AvailableFreeSpace ) ) / Convert . ToDouble ( drv . TotalSize ) * 100 ;
195
195
196
196
int ? progressValue = Convert . ToInt32 ( usingSize ) ;
@@ -262,8 +262,8 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK
262
262
263
263
return new Result
264
264
{
265
- Title = Context . API . GetTranslation ( " plugin_explorer_openresultfolder" ) ,
266
- SubTitle = Context . API . GetTranslation ( " plugin_explorer_openresultfolder_subtitle" ) ,
265
+ Title = Localize . plugin_explorer_openresultfolder ( ) ,
266
+ SubTitle = Localize . plugin_explorer_openresultfolder_subtitle ( ) ,
267
267
AutoCompleteText = GetPathWithActionKeyword ( folderPath , ResultType . Folder , actionKeyword ) ,
268
268
IcoPath = folderPath ,
269
269
Score = 500 ,
@@ -330,12 +330,12 @@ internal static Result CreateFileResult(string filePath, Query query, int score
330
330
}
331
331
catch ( Exception ex )
332
332
{
333
- Context . API . ShowMsgBox ( ex . Message , Context . API . GetTranslation ( " plugin_explorer_openfile_error" ) ) ;
333
+ Context . API . ShowMsgBox ( ex . Message , Localize . plugin_explorer_openfile_error ( ) ) ;
334
334
}
335
335
336
336
return true ;
337
337
} ,
338
- TitleToolTip = Main . Context . API . GetTranslation ( " plugin_explorer_plugin_ToolTipOpenContainingFolder" ) ,
338
+ TitleToolTip = Localize . plugin_explorer_plugin_ToolTipOpenContainingFolder ( ) ,
339
339
SubTitleToolTip = Settings . DisplayMoreInformationInToolTip ? GetFileMoreInfoTooltip ( filePath ) : filePath ,
340
340
ContextData = new SearchResult { Type = ResultType . File , FullPath = filePath , WindowsIndexed = windowsIndexed }
341
341
} ;
@@ -374,8 +374,7 @@ private static string GetFileMoreInfoTooltip(string filePath)
374
374
var fileSize = PreviewPanel . GetFileSize ( filePath ) ;
375
375
var fileCreatedAt = PreviewPanel . GetFileCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
376
376
var fileModifiedAt = PreviewPanel . GetFileLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
377
- return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
378
- filePath , fileSize , fileCreatedAt , fileModifiedAt , Environment . NewLine ) ;
377
+ return Localize . plugin_explorer_plugin_tooltip_more_info ( filePath , fileSize , fileCreatedAt , fileModifiedAt , Environment . NewLine ) ;
379
378
}
380
379
catch ( Exception e )
381
380
{
@@ -391,8 +390,7 @@ private static string GetFolderMoreInfoTooltip(string folderPath)
391
390
var folderSize = PreviewPanel . GetFolderSize ( folderPath ) ;
392
391
var folderCreatedAt = PreviewPanel . GetFolderCreatedAt ( folderPath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
393
392
var folderModifiedAt = PreviewPanel . GetFolderLastModifiedAt ( folderPath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
394
- return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
395
- folderPath , folderSize , folderCreatedAt , folderModifiedAt , Environment . NewLine ) ;
393
+ return Localize . plugin_explorer_plugin_tooltip_more_info ( folderPath , folderSize , folderCreatedAt , folderModifiedAt , Environment . NewLine ) ;
396
394
}
397
395
catch ( Exception e )
398
396
{
@@ -403,8 +401,7 @@ private static string GetFolderMoreInfoTooltip(string folderPath)
403
401
404
402
private static string GetVolumeMoreInfoTooltip ( string volumePath , string freespace , string totalspace )
405
403
{
406
- return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_volume" ) ,
407
- volumePath , freespace , totalspace , Environment . NewLine ) ;
404
+ return Localize . plugin_explorer_plugin_tooltip_more_info_volume ( volumePath , freespace , totalspace , Environment . NewLine ) ;
408
405
}
409
406
410
407
private static readonly string [ ] MediaExtensions =
0 commit comments