@@ -67,7 +67,14 @@ public MainViewModel(Settings settings)
67
67
{
68
68
if ( args . PropertyName == nameof ( Settings . WindowSize ) )
69
69
{
70
- OnPropertyChanged ( nameof ( MainWindowWidth ) ) ;
70
+ }
71
+ switch ( args . PropertyName ) {
72
+ case nameof ( Settings . WindowSize ) :
73
+ OnPropertyChanged ( nameof ( MainWindowWidth ) ) ;
74
+ break ;
75
+ case nameof ( Settings . Language ) :
76
+ Culture = new CultureInfo ( Settings . Language ) ;
77
+ break ;
71
78
}
72
79
} ;
73
80
@@ -99,6 +106,8 @@ public MainViewModel(Settings settings)
99
106
RegisterClockAndDateUpdateAsync ( ) ;
100
107
101
108
SetOpenResultModifiers ( ) ;
109
+
110
+ Culture = new CultureInfo ( Settings . Language ) ;
102
111
}
103
112
104
113
private void RegisterViewUpdate ( )
@@ -334,20 +343,21 @@ private void Esc()
334
343
public Settings Settings { get ; }
335
344
public string ClockText { get ; private set ; }
336
345
public string DateText { get ; private set ; }
346
+ public CultureInfo Culture { get ; set ; }
337
347
338
- public CultureInfo cultureInfo => new CultureInfo ( Settings . Language ) ;
339
348
private async Task RegisterClockAndDateUpdateAsync ( )
340
349
{
341
350
var timer = new PeriodicTimer ( TimeSpan . FromSeconds ( 1 ) ) ;
342
351
// ReSharper disable once MethodSupportsCancellation
343
352
while ( await timer . WaitForNextTickAsync ( ) . ConfigureAwait ( false ) )
344
353
{
345
354
if ( Settings . UseClock )
346
- ClockText = DateTime . Now . ToString ( Settings . TimeFormat , cultureInfo ) ;
355
+ ClockText = DateTime . Now . ToString ( Settings . TimeFormat , Culture ) ;
347
356
if ( Settings . UseDate )
348
- DateText = DateTime . Now . ToString ( Settings . DateFormat , cultureInfo ) ;
357
+ DateText = DateTime . Now . ToString ( Settings . DateFormat , Culture ) ;
349
358
}
350
359
}
360
+
351
361
public ResultsViewModel Results { get ; private set ; }
352
362
353
363
public ResultsViewModel ContextMenu { get ; private set ; }
0 commit comments