From b5f831876e03008f685b29aa3e9fcafd89e90e5f Mon Sep 17 00:00:00 2001 From: Kim Meiser Date: Wed, 5 Jun 2024 07:32:18 +0200 Subject: [PATCH] Use Windows display language instead of regional format Translate UI content based on CurrentUICulture instead of CurrentCulture. CurrentCulture is the .NET representation of the default user locale of the system. This controls default number and date formatting and the like. CurrentUICulture refers to the default user interface language, a setting introduced in Windows 2000. This is primarily regarding the UI localization/translation part of your app. see also * https://stackoverflow.com/questions/329033/what-is-the-difference-between-currentculture-and-currentuiculture-properties-of * https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentuiculture?view=net-8.0 * https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-globalization-cultureinfo-currentuiculture fix #2141 --- src/UniGetUI.Core.LanguageEngine/LanguageEngine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UniGetUI.Core.LanguageEngine/LanguageEngine.cs b/src/UniGetUI.Core.LanguageEngine/LanguageEngine.cs index bccf0a302..6d3edf419 100644 --- a/src/UniGetUI.Core.LanguageEngine/LanguageEngine.cs +++ b/src/UniGetUI.Core.LanguageEngine/LanguageEngine.cs @@ -15,7 +15,7 @@ public LanguageEngine(string ForceLanguage = "") string LangName = Settings.GetValue("PreferredLanguage"); if (LangName == "default" || LangName == "") { - LangName = System.Globalization.CultureInfo.CurrentCulture.ToString().Replace("-", "_"); + LangName = System.Globalization.CultureInfo.CurrentUICulture.ToString().Replace("-", "_"); } LoadLanguage((ForceLanguage != "")? ForceLanguage: LangName); }