Set global locale to de-DE

This commit is contained in:
2023-07-13 16:57:39 +02:00
parent 79a92be9d2
commit ad538ba767

View File

@ -8,6 +8,9 @@ using Elwig.Helpers;
using Elwig.Helpers.Weighing;
using System.Collections.Generic;
using System.Windows.Threading;
using System.Globalization;
using System.Threading;
using System.Windows.Markup;
namespace Elwig {
public partial class App : Application {
@ -32,6 +35,16 @@ namespace Elwig {
}
protected override void OnStartup(StartupEventArgs evt) {
var locale = new CultureInfo("de-DE"); // de-AT uses ' ' as thousands separator :(
Thread.CurrentThread.CurrentCulture = locale;
Thread.CurrentThread.CurrentUICulture = locale;
CultureInfo.DefaultThreadCurrentCulture = locale;
CultureInfo.DefaultThreadCurrentUICulture = locale;
FrameworkElement.LanguageProperty.OverrideMetadata(
typeof(FrameworkElement),
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))
);
Dictionary<string, string> branches = new();
using (var ctx = new AppDbContext()) {
if (!ctx.Database.CanConnect()) {