@@ -48,7 +48,7 @@ private void WriteToLog(string message, LogLevel level)
4848 {
4949 if ( ! IsOutputLoggingEnabled ) return ;
5050
51- switch ( level )
51+ switch ( level )
5252 {
5353 case LogLevel . Debug :
5454 PowerShellLog . Debug ( message ) ;
@@ -63,7 +63,7 @@ private void WriteToLog(string message, LogLevel level)
6363 case LogLevel . Warning :
6464 PowerShellLog . Warn ( message ) ;
6565 break ;
66- }
66+ }
6767 }
6868
6969 /// <summary>
@@ -112,7 +112,7 @@ public override SecureString ReadLineAsSecureString()
112112 job . MessageQueue . PutMessage ( new ShowMultiValuePromptMessage ( options , "600" , "200" ,
113113 "Sitecore PowerShell Extensions" , " " , string . Empty , string . Empty , string . Empty , false , null , null ,
114114 host . SessionKey ) ) ;
115- var values = ( object [ ] ) job . MessageQueue . GetResult ( ) ?? new object [ ] { string . Empty } ;
115+ var values = ( object [ ] ) job . MessageQueue . GetResult ( ) ?? new object [ ] { string . Empty } ;
116116
117117 return ToSecureString ( ( ( Hashtable ) values [ 0 ] ) [ "Value" ] as string ) ;
118118 }
@@ -152,7 +152,7 @@ public override void WriteLine(string value)
152152
153153 public override void WriteErrorLine ( string value )
154154 {
155-
155+
156156 var splitter = new BufferSplitterCollection ( OutputLineType . Error , value , RawUI . BufferSize . Width ,
157157 PrivateData . ErrorForegroundColor ,
158158 PrivateData . ErrorBackgroundColor , true ) ;
@@ -176,14 +176,14 @@ public override void WriteProgress(long sourceId, ProgressRecord record)
176176 var message = Message . Parse ( this , "ise:updateprogress" ) ;
177177 message . Arguments . Add ( "Activity" , record . Activity ) ;
178178 message . Arguments . Add ( "ActivityId" , record . ActivityId . ToString ( CultureInfo . InvariantCulture ) ) ;
179- message . Arguments . Add ( "CurrentOperation" , record . CurrentOperation ) ;
180- message . Arguments . Add ( "StatusDescription" , record . StatusDescription ) ;
179+ message . Arguments . Add ( "CurrentOperation" , Sitecore . Globalization . Translate . Text ( record . CurrentOperation ) ) ;
180+ message . Arguments . Add ( "StatusDescription" , Sitecore . Globalization . Translate . Text ( record . StatusDescription ) ) ;
181181 message . Arguments . Add ( "ParentActivityId" , record . ParentActivityId . ToString ( CultureInfo . InvariantCulture ) ) ;
182182 message . Arguments . Add ( "PercentComplete" , record . PercentComplete . ToString ( CultureInfo . InvariantCulture ) ) ;
183183 message . Arguments . Add ( "RecordType" , record . RecordType . ToString ( ) ) ;
184184 message . Arguments . Add ( "SecondsRemaining" , record . SecondsRemaining . ToString ( CultureInfo . InvariantCulture ) ) ;
185185 var sheerMessage = new SendMessageMessage ( message , false ) ;
186-
186+
187187 var jobManager = TypeResolver . ResolveFromCache < IJobManager > ( ) ;
188188 var job = jobManager . GetContextJob ( ) ;
189189 if ( job != null )
@@ -224,7 +224,7 @@ public override Dictionary<string, PSObject> Prompt(string caption, string messa
224224
225225 var secureOptions = new Dictionary < string , bool > ( ) ;
226226
227- for ( var i = 0 ; i < descriptions . Count ; i ++ )
227+ for ( var i = 0 ; i < descriptions . Count ; i ++ )
228228 {
229229 var description = descriptions [ i ] ;
230230 var isSecure = description . ParameterTypeName . Contains ( "SecureString" ) ;
@@ -244,13 +244,13 @@ public override Dictionary<string, PSObject> Prompt(string caption, string messa
244244 string . IsNullOrEmpty ( caption ) ? "Sitecore PowerShell Extensions" : caption ,
245245 string . IsNullOrEmpty ( message ) ? " " : message , string . Empty , string . Empty , string . Empty , false ,
246246 null , null , host . SessionKey ) ) ;
247- var values = ( object [ ] ) job . MessageQueue . GetResult ( ) ;
247+ var values = ( object [ ] ) job . MessageQueue . GetResult ( ) ;
248248
249249 return values ? . Cast < Hashtable > ( )
250250 . ToDictionary ( value => value [ "Name" ] . ToString ( ) ,
251251 value =>
252252 secureOptions [ value [ "Name" ] . ToString ( ) ]
253- ? PSObject . AsPSObject ( ToSecureString ( ( string ) value [ "Value" ] ) )
253+ ? PSObject . AsPSObject ( ToSecureString ( ( string ) value [ "Value" ] ) )
254254 : PSObject . AsPSObject ( value [ "Value" ] ) ) ;
255255 }
256256
@@ -281,7 +281,7 @@ public override PSCredential PromptForCredential(string caption, string message,
281281
282282 public override int PromptForChoice ( string caption , string message , Collection < ChoiceDescription > choices ,
283283 int defaultChoice )
284- {
284+ {
285285 if ( ! CheckSessionCanDoInteractiveAction ( nameof ( PromptForChoice ) ) ) return - 1 ;
286286
287287
@@ -298,14 +298,14 @@ public override int PromptForChoice(string caption, string message, Collection<C
298298 var job = jobManager . GetContextJob ( ) ;
299299
300300 Context . Site = Factory . GetSite ( job . Options . SiteName ) ;
301- var lineWidth = choices . Count * 80 + 140 ;
302- var strLineWidth = lineWidth / 8 ;
301+ var lineWidth = choices . Count * 80 + 140 ;
302+ var strLineWidth = lineWidth / 8 ;
303303 var lineHeight = 0 ;
304304 foreach ( var line in message . Split ( '\n ' ) )
305305 {
306- lineHeight += 1 + line . Length / strLineWidth ;
306+ lineHeight += 1 + line . Length / strLineWidth ;
307307 }
308- lineHeight = Math . Max ( lineHeight * 21 + 130 , 150 ) ;
308+ lineHeight = Math . Max ( lineHeight * 21 + 130 , 150 ) ;
309309 var jobUiManager = TypeResolver . Resolve < IJobMessageManager > ( ) ;
310310 var dialogResult = jobUiManager . ShowModalDialog ( parameters , "ConfirmChoice" ,
311311 lineWidth . ToString ( CultureInfo . InvariantCulture ) , lineHeight . ToString ( CultureInfo . InvariantCulture ) ) ;
@@ -339,7 +339,7 @@ public virtual bool CheckSessionCanDoInteractiveAction(string operation, bool th
339339 var message = string . IsNullOrEmpty ( operation )
340340 ? "Non interactive session cannot perform an interactive operation."
341341 : $ "Non interactive session cannot perform an interactive '{ operation } ' operation.";
342-
342+
343343 PowerShellLog . Debug ( message ) ;
344344
345345 if ( throwException )
0 commit comments