mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix CultureInfo Reflect Preview/Flow
This commit is contained in:
parent
51dc61376e
commit
6c22bdaa16
2 changed files with 11 additions and 4 deletions
|
|
@ -23,6 +23,7 @@ using ISavable = Flow.Launcher.Plugin.ISavable;
|
|||
using System.IO;
|
||||
using System.Collections.Specialized;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
|
|
@ -326,6 +327,7 @@ namespace Flow.Launcher.ViewModel
|
|||
public string ClockText { get; private set; }
|
||||
public string DateText { get; private set; }
|
||||
|
||||
public CultureInfo cultureInfo => new CultureInfo(Settings.Language);
|
||||
private async Task RegisterClockAndDateUpdateAsync()
|
||||
{
|
||||
var timer = new PeriodicTimer(TimeSpan.FromSeconds(1));
|
||||
|
|
@ -333,9 +335,9 @@ namespace Flow.Launcher.ViewModel
|
|||
while (await timer.WaitForNextTickAsync().ConfigureAwait(false))
|
||||
{
|
||||
if (Settings.UseClock)
|
||||
ClockText = DateTime.Now.ToString(Settings.TimeFormat);
|
||||
ClockText = DateTime.Now.ToString(Settings.TimeFormat, cultureInfo);
|
||||
if (Settings.UseDate)
|
||||
DateText = DateTime.Now.ToString(Settings.DateFormat);
|
||||
DateText = DateTime.Now.ToString(Settings.DateFormat, cultureInfo);
|
||||
}
|
||||
}
|
||||
public ResultsViewModel Results { get; private set; }
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ namespace Flow.Launcher.ViewModel
|
|||
case nameof(Settings.TimeFormat):
|
||||
OnPropertyChanged(nameof(ClockText));
|
||||
break;
|
||||
case nameof(Settings.Language):
|
||||
OnPropertyChanged(nameof(ClockText));
|
||||
OnPropertyChanged(nameof(DateText));
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -80,6 +84,7 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public CultureInfo cultureInfo => new CultureInfo(Settings.Language);
|
||||
public bool StartFlowLauncherOnSystemStartup
|
||||
{
|
||||
get => Settings.StartFlowLauncherOnSystemStartup;
|
||||
|
|
@ -500,9 +505,9 @@ namespace Flow.Launcher.ViewModel
|
|||
set { Settings.DateFormat = value; }
|
||||
}
|
||||
|
||||
public string ClockText => DateTime.Now.ToString(TimeFormat);
|
||||
public string ClockText => DateTime.Now.ToString(TimeFormat, cultureInfo);
|
||||
|
||||
public string DateText => DateTime.Now.ToString(DateFormat);
|
||||
public string DateText => DateTime.Now.ToString(DateFormat, cultureInfo);
|
||||
|
||||
|
||||
public double WindowWidthSize
|
||||
|
|
|
|||
Loading…
Reference in a new issue