mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
Audit culture bugs (#7707)
* Added comments and fixed CultureInfo / StringComparison where appropriate * Addressed comments * Fixed comment
This commit is contained in:
@@ -66,6 +66,7 @@ namespace ColorPicker.Helpers
|
||||
saturation = Math.Round(saturation * 100);
|
||||
lightness = Math.Round(lightness * 100);
|
||||
|
||||
// Using InvariantCulture since this is used for color representation
|
||||
return $"hsl({hue.ToString(CultureInfo.InvariantCulture)}"
|
||||
+ $", {saturation.ToString(CultureInfo.InvariantCulture)}%"
|
||||
+ $", {lightness.ToString(CultureInfo.InvariantCulture)}%)";
|
||||
@@ -84,6 +85,7 @@ namespace ColorPicker.Helpers
|
||||
saturation = Math.Round(saturation * 100);
|
||||
value = Math.Round(value * 100);
|
||||
|
||||
// Using InvariantCulture since this is used for color representation
|
||||
return $"hsv({hue.ToString(CultureInfo.InvariantCulture)}"
|
||||
+ $", {saturation.ToString(CultureInfo.InvariantCulture)}%"
|
||||
+ $", {value.ToString(CultureInfo.InvariantCulture)}%)";
|
||||
@@ -103,6 +105,7 @@ namespace ColorPicker.Helpers
|
||||
yellow = Math.Round(yellow * 100);
|
||||
blackKey = Math.Round(blackKey * 100);
|
||||
|
||||
// Using InvariantCulture since this is used for color representation
|
||||
return $"cmyk({cyan.ToString(CultureInfo.InvariantCulture)}%"
|
||||
+ $", {magenta.ToString(CultureInfo.InvariantCulture)}%"
|
||||
+ $", {yellow.ToString(CultureInfo.InvariantCulture)}%"
|
||||
|
||||
@@ -20,7 +20,8 @@ namespace ColorPicker.Helpers
|
||||
Directory.CreateDirectory(ApplicationLogPath);
|
||||
}
|
||||
|
||||
var logFilePath = Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.CurrentCulture) + ".txt");
|
||||
// Using InvariantCulture since this is used for a log file name
|
||||
var logFilePath = Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".txt");
|
||||
|
||||
Trace.Listeners.Add(new TextWriterTraceListener(logFilePath));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user