From 95b4fd0eac983e7d75f9117de2ac8d7cc7a6fce2 Mon Sep 17 00:00:00 2001 From: Etienne BAUDOUX Date: Sat, 16 Jul 2022 18:35:12 -0700 Subject: [PATCH 1/3] New Crowdin updates (#593) * fix: new translations in JsonYaml.resw (JsonYaml.resw) from Crowdin * fix: new translations in GuidGenerator.resw (GuidGenerator.resw) from Crowdin * fix: new translations in Timestamp.resw (Timestamp.resw) from Crowdin --- src/dev/impl/DevToys/Strings/zh-Hans/GuidGenerator.resw | 2 +- src/dev/impl/DevToys/Strings/zh-Hans/JsonYaml.resw | 2 +- src/dev/impl/DevToys/Strings/zh-Hans/Timestamp.resw | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dev/impl/DevToys/Strings/zh-Hans/GuidGenerator.resw b/src/dev/impl/DevToys/Strings/zh-Hans/GuidGenerator.resw index 00a3c59919..a643c97be6 100644 --- a/src/dev/impl/DevToys/Strings/zh-Hans/GuidGenerator.resw +++ b/src/dev/impl/DevToys/Strings/zh-Hans/GuidGenerator.resw @@ -139,7 +139,7 @@ 连字符 - x + × 要生成的 UUID 个数 diff --git a/src/dev/impl/DevToys/Strings/zh-Hans/JsonYaml.resw b/src/dev/impl/DevToys/Strings/zh-Hans/JsonYaml.resw index 9db77838e9..e685bb964a 100644 --- a/src/dev/impl/DevToys/Strings/zh-Hans/JsonYaml.resw +++ b/src/dev/impl/DevToys/Strings/zh-Hans/JsonYaml.resw @@ -130,7 +130,7 @@ 转换 - JSON <> YAML + JSON ↔ YAML 4 个空格 diff --git a/src/dev/impl/DevToys/Strings/zh-Hans/Timestamp.resw b/src/dev/impl/DevToys/Strings/zh-Hans/Timestamp.resw index d640bb655b..92d0203f00 100644 --- a/src/dev/impl/DevToys/Strings/zh-Hans/Timestamp.resw +++ b/src/dev/impl/DevToys/Strings/zh-Hans/Timestamp.resw @@ -179,7 +179,7 @@ 世界标准时间(UTC) - UtcTicks + UTC 时间戳 From 085d568b45b71a7c1ee0f17651e681a27b0caf86 Mon Sep 17 00:00:00 2001 From: Etienne BAUDOUX Date: Sat, 16 Jul 2022 18:37:28 -0700 Subject: [PATCH 2/3] Added contrast ratio checker (#594) --- src/dev/impl/DevToys/DevToys.csproj | 3 + src/dev/impl/DevToys/LanguageManager.cs | 58 ++- .../DevToys/Strings/en-US/ColorPicker.resw | 50 ++- src/dev/impl/DevToys/Themes/Generic.xaml | 6 +- .../UI/Converters/BooleanToBrushConverter.cs | 41 ++ .../UI/Converters/BooleanToStringConverter.cs | 40 ++ .../UI/Extensions/ControlSizeTrigger.cs | 74 ++++ .../ColorPicker/ColorPickerToolViewModel.cs | 102 ++++- .../ColorPicker/ColorPickerToolPage.xaml | 380 +++++++++++++++--- .../PngJpgCompressorToolPage.xaml | 4 +- 10 files changed, 664 insertions(+), 94 deletions(-) create mode 100644 src/dev/impl/DevToys/UI/Converters/BooleanToBrushConverter.cs create mode 100644 src/dev/impl/DevToys/UI/Converters/BooleanToStringConverter.cs create mode 100644 src/dev/impl/DevToys/UI/Extensions/ControlSizeTrigger.cs diff --git a/src/dev/impl/DevToys/DevToys.csproj b/src/dev/impl/DevToys/DevToys.csproj index aff96e0ff2..0c93d4b5de 100644 --- a/src/dev/impl/DevToys/DevToys.csproj +++ b/src/dev/impl/DevToys/DevToys.csproj @@ -86,9 +86,12 @@ ToolProvidersGridView.xaml + + + diff --git a/src/dev/impl/DevToys/LanguageManager.cs b/src/dev/impl/DevToys/LanguageManager.cs index dafab7781a..660ed1dc94 100644 --- a/src/dev/impl/DevToys/LanguageManager.cs +++ b/src/dev/impl/DevToys/LanguageManager.cs @@ -585,14 +585,9 @@ public class ColorPickerStrings : ObservableObject public string SearchKeywords => _resources.GetString("SearchKeywords"); /// - /// Gets the resource BlackText. + /// Gets the resource TextColor. /// - public string BlackText => _resources.GetString("BlackText"); - - /// - /// Gets the resource ColorPicker. - /// - public string ColorPicker => _resources.GetString("ColorPicker"); + public string TextColor => _resources.GetString("TextColor"); /// /// Gets the resource Configuration. @@ -620,9 +615,54 @@ public class ColorPickerStrings : ObservableObject public string SelectedColor => _resources.GetString("SelectedColor"); /// - /// Gets the resource WhiteText. + /// Gets the resource BackgroundColor. + /// + public string BackgroundColor => _resources.GetString("BackgroundColor"); + + /// + /// Gets the resource ContrastRatio. + /// + public string ContrastRatio => _resources.GetString("ContrastRatio"); + + /// + /// Gets the resource Fail. + /// + public string Fail => _resources.GetString("Fail"); + + /// + /// Gets the resource LargeText. + /// + public string LargeText => _resources.GetString("LargeText"); + + /// + /// Gets the resource Pass. + /// + public string Pass => _resources.GetString("Pass"); + + /// + /// Gets the resource SampleText. + /// + public string SampleText => _resources.GetString("SampleText"); + + /// + /// Gets the resource SampleTextTitle. + /// + public string SampleTextTitle => _resources.GetString("SampleTextTitle"); + + /// + /// Gets the resource SmallText. + /// + public string SmallText => _resources.GetString("SmallText"); + + /// + /// Gets the resource WCAG_AA. + /// + public string WCAG_AA => _resources.GetString("WCAG_AA"); + + /// + /// Gets the resource WCAG_AAA. /// - public string WhiteText => _resources.GetString("WhiteText"); + public string WCAG_AAA => _resources.GetString("WCAG_AAA"); } public class CommonStrings : ObservableObject diff --git a/src/dev/impl/DevToys/Strings/en-US/ColorPicker.resw b/src/dev/impl/DevToys/Strings/en-US/ColorPicker.resw index 81d59ab47f..2ee28453b0 100644 --- a/src/dev/impl/DevToys/Strings/en-US/ColorPicker.resw +++ b/src/dev/impl/DevToys/Strings/en-US/ColorPicker.resw @@ -118,25 +118,22 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Color Picker tool + Color Picker and contrast ratio tool - Color Picker + Color Picker & Contrast - Pick up a color + Pick up a color or two and validate the contrast ratio - Color Picker + Color Picker & Contrast - + RGB WCAG - - Black text - - - Color picker + + Text color Configuration @@ -153,7 +150,36 @@ Selected color - - White text + + Background color + + + Contrast ratio + + + Fail + + + Large text + + + Pass + + + Sit kasd feugait takimata in eirmod sadipscing sanctus consectetuer voluptua dolor dolor dolore rebum. + "Lorem ipsum" text used a sample text for comparing the background color over the text color. + + + Lorem ipsum dolor + "Lorem ipsum" text used a sample text for comparing the background color over the text color. + + + Small text + + + WCAG AA + + + WCAG AAA \ No newline at end of file diff --git a/src/dev/impl/DevToys/Themes/Generic.xaml b/src/dev/impl/DevToys/Themes/Generic.xaml index 49018e8e2f..2db6d5a159 100644 --- a/src/dev/impl/DevToys/Themes/Generic.xaml +++ b/src/dev/impl/DevToys/Themes/Generic.xaml @@ -8,14 +8,14 @@ - + - + @@ -43,7 +43,7 @@ - +