Skip to content

Commit 4aaa268

Browse files
cache culture info
1 parent 0e6fbf2 commit 4aaa268

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ public SettingWindowViewModel(Updater updater, IPortable portable)
5656
OnPropertyChanged(nameof(ClockText));
5757
break;
5858
case nameof(Settings.Language):
59+
Culture = new CultureInfo(Settings.Language);
5960
OnPropertyChanged(nameof(ClockText));
6061
OnPropertyChanged(nameof(DateText));
6162
break;
6263
}
6364
};
65+
66+
Culture = new CultureInfo(Settings.Language);
6467
}
6568

6669
public Settings Settings { get; set; }
@@ -84,7 +87,7 @@ public bool AutoUpdates
8487
}
8588
}
8689

87-
public CultureInfo cultureInfo => new CultureInfo(Settings.Language);
90+
public CultureInfo Culture { get; private set; }
8891

8992
public bool StartFlowLauncherOnSystemStartup
9093
{
@@ -506,10 +509,9 @@ public string DateFormat
506509
set { Settings.DateFormat = value; }
507510
}
508511

509-
public string ClockText => DateTime.Now.ToString(TimeFormat, cultureInfo);
510-
511-
public string DateText => DateTime.Now.ToString(DateFormat, cultureInfo);
512+
public string ClockText => DateTime.Now.ToString(TimeFormat, Culture);
512513

514+
public string DateText => DateTime.Now.ToString(DateFormat, Culture);
513515

514516
public double WindowWidthSize
515517
{

0 commit comments

Comments
 (0)