Pārlūkot izejas kodu

Fixes #3687. ColorPicker isn't respecting the current UI culture.

BDisp 11 mēneši atpakaļ
vecāks
revīzija
385a1913f7
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      Terminal.Gui/Drawing/ColorStrings.cs

+ 3 - 3
Terminal.Gui/Drawing/ColorStrings.cs

@@ -21,7 +21,7 @@ public static class ColorStrings
     public static string? GetW3CColorName (Color color)
     public static string? GetW3CColorName (Color color)
     {
     {
         // Fetch the color name from the resource file
         // Fetch the color name from the resource file
-        return _resourceManager.GetString ($"#{color.R:X2}{color.G:X2}{color.B:X2}", CultureInfo.CurrentCulture);
+        return _resourceManager.GetString ($"#{color.R:X2}{color.G:X2}{color.B:X2}", CultureInfo.CurrentUICulture);
     }
     }
 
 
     /// <summary>
     /// <summary>
@@ -30,7 +30,7 @@ public static class ColorStrings
     /// <returns></returns>
     /// <returns></returns>
     public static IEnumerable<string> GetW3CColorNames ()
     public static IEnumerable<string> GetW3CColorNames ()
     {
     {
-        foreach (DictionaryEntry entry in _resourceManager.GetResourceSet (CultureInfo.CurrentCulture, true, true)!)
+        foreach (DictionaryEntry entry in _resourceManager.GetResourceSet (CultureInfo.CurrentUICulture, true, true)!)
         {
         {
             string keyName = entry.Key.ToString () ?? string.Empty;
             string keyName = entry.Key.ToString () ?? string.Empty;
 
 
@@ -50,7 +50,7 @@ public static class ColorStrings
     public static bool TryParseW3CColorName (string name, out Color color)
     public static bool TryParseW3CColorName (string name, out Color color)
     {
     {
         // Iterate through all resource entries to find the matching color name
         // Iterate through all resource entries to find the matching color name
-        foreach (DictionaryEntry entry in _resourceManager.GetResourceSet (CultureInfo.CurrentCulture, true, true)!)
+        foreach (DictionaryEntry entry in _resourceManager.GetResourceSet (CultureInfo.CurrentUICulture, true, true)!)
         {
         {
             if (entry.Value is string colorName && colorName.Equals (name, StringComparison.OrdinalIgnoreCase))
             if (entry.Value is string colorName && colorName.Equals (name, StringComparison.OrdinalIgnoreCase))
             {
             {