mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixes #3687. ColorPicker isn't respecting the current UI culture.
This commit is contained in:
@@ -21,7 +21,7 @@ public static class ColorStrings
|
||||
public static string? GetW3CColorName (Color color)
|
||||
{
|
||||
// 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>
|
||||
@@ -30,7 +30,7 @@ public static class ColorStrings
|
||||
/// <returns></returns>
|
||||
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;
|
||||
|
||||
@@ -50,7 +50,7 @@ public static class ColorStrings
|
||||
public static bool TryParseW3CColorName (string name, out Color color)
|
||||
{
|
||||
// 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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user