mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-27 23:31:45 +00:00
d319fc19f9
- Reverted target framework to .NET 8.0 for stability. - Added autofocus to all dialog input fields (e.g. password dialogs). - Fixed crash when relogging into accounts without Steam Guard and added proper error message. - Unified and improved “Confirm Action” dialog design and text clarity. - Added setting to disable ripple effect animations for better performance. - Reduced minimum auto-confirmation timer interval from 10s to 5s. - App now auto-selects the most appropriate language on first launch. - Added trimming to proxy parse input - Fixed incorrect hint about maFile binding when using login-based mode. - Added ESC key behavior to remove focus from account search - Minor UI polish and cleanup across dialogs.
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using NebulaAuth.Core;
|
|
|
|
namespace NebulaAuth.Utility;
|
|
|
|
public static class LanguageUtility
|
|
{
|
|
public static LocalizationLanguage DetectPreferredLanguage()
|
|
{
|
|
var userCulture = CultureInfo.CurrentUICulture;
|
|
var userLang = userCulture.TwoLetterISOLanguageName;
|
|
var userRegion = userCulture.Name;
|
|
|
|
switch (userLang)
|
|
{
|
|
case "ru": return LocalizationLanguage.Russian;
|
|
case "uk": return LocalizationLanguage.Ukrainian;
|
|
case "en": return LocalizationLanguage.English;
|
|
}
|
|
|
|
if (userRegion.EndsWith("UA", StringComparison.OrdinalIgnoreCase))
|
|
return LocalizationLanguage.Ukrainian;
|
|
|
|
string[] cisRegions =
|
|
[
|
|
"RU", "BY", "KZ", "KG", "TJ", "TM", "UZ", "AM", "AZ", "GE", "MD"
|
|
];
|
|
|
|
if (cisRegions.Any(r => userRegion.EndsWith(r, StringComparison.OrdinalIgnoreCase)))
|
|
return LocalizationLanguage.Russian;
|
|
|
|
return LocalizationLanguage.English;
|
|
}
|
|
} |