diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs index 69e4cd9a1f..f27ff9fe68 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonPropertyValueAssignment.cs @@ -7,6 +7,7 @@ using System; using System.Drawing; +using System.Globalization; using System.Windows.Forms; using System.Reflection; @@ -94,7 +95,7 @@ namespace ICSharpCode.PythonBinding static string GetFontAsString(Font font) { - return String.Concat(font.GetType().FullName, "(\"", font.Name, "\", ", font.Size, ", ", typeof(FontStyle).FullName, ".", font.Style, ", ", typeof(GraphicsUnit).FullName, ".", font.Unit, ", ", font.GdiCharSet, ")"); + return String.Concat(font.GetType().FullName, "(\"", font.Name, "\", ", font.Size.ToString(CultureInfo.InvariantCulture), ", ", typeof(FontStyle).FullName, ".", font.Style, ", ", typeof(GraphicsUnit).FullName, ".", font.Unit, ", ", font.GdiCharSet, ")"); } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonPropertyAssignmentToStringTests.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonPropertyAssignmentToStringTests.cs index 6bc8b8c66e..3e092b13d3 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonPropertyAssignmentToStringTests.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonPropertyAssignmentToStringTests.cs @@ -7,6 +7,7 @@ using System; using System.Drawing; +using System.Globalization; using ICSharpCode.PythonBinding; using NUnit.Framework; @@ -29,9 +30,15 @@ namespace PythonBinding.Tests.Designer [Test] public void FontToString() { - Font font = new Font("Times New Roman", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); - Assert.AreEqual("System.Drawing.Font(\"Times New Roman\", 8.25, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0)", - PythonPropertyValueAssignment.ToString(font)); + CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture; + try { + System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("de-DE"); + Font font = new Font("Times New Roman", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + Assert.AreEqual("System.Drawing.Font(\"Times New Roman\", 8.25, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0)", + PythonPropertyValueAssignment.ToString(font)); + } finally { + System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo; + } } } }