[ColorPicker]Fix localization of color names (#22837)

* [ColorPicker] Restructure to have color names localized

* [ColorPicker] Restrucure code to have localised color names

* Fix analyzer errors

* [ColorPicker] add comments
This commit is contained in:
Laszlo Nemeth
2022-12-20 16:03:25 +01:00
committed by GitHub
parent 37cb62f6eb
commit 3739b771e5
17 changed files with 1517 additions and 637 deletions

View File

@@ -4,7 +4,7 @@
using System;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
using Microsoft.UI.Xaml.Data;
namespace Microsoft.PowerToys.Settings.UI.Converters
@@ -15,7 +15,8 @@ namespace Microsoft.PowerToys.Settings.UI.Converters
{
if (value != null)
{
return ColorFormatHelper.GetStringRepresentation(null, (string)value);
// get string representation in 2 steps. First replace all color specific number values then in 2nd step replace color name with localisation
return Library.Helpers.ColorNameHelper.ReplaceName(ColorFormatHelper.GetStringRepresentation(null, (string)value), null);
}
else
{