Skip to content

Commit 2171b4a

Browse files
authored
Fixes [3164]-V105-LTS Font property values are being serialized depending of the current culture in exported XML theme (#3179)
Force en-US TypeConverter serialization to prevent localized values (e.g., “(Ninguna)”) and ensure the exported theme XML is always in English. Fixes #3164
2 parents 5321de7 + 7f68cdb commit 2171b4a

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

Documents/Changelog/Changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646

4747
## 2026-04-20 - Build 2604 (Version 105-LTS - Patch 2) - April 2026
4848

49+
* Resolved [#3164](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3164), Toolkit: Font property values are being serialized depending of the current culture in exported XML theme file
4950
* Resolved [#3013](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3013), Maximized form's size exceeds the screen's working area
50-
* Implemented [#3173](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3173), Use pattern matching
51+
* Implemented [#3173](https://github.com/Krypton-Suite/Standad-Toolkit/issues/3173), Use pattern matching
5152
* Resolved [#3201](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3201), Resolves potential memory leaks in `KryptonDataGridViewRatingColumn`
5253
* Resolved [#3163](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3163), Form Icon Misplaced in Contextual Tabs
5354
* Implemented [#3113](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3113), TextBox item for KryptonContextMenu-Items

Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3595,12 +3595,26 @@ private void ExportObjectToElement(XmlDocument doc,
35953595
}
35963596
else
35973597
{
3598-
// We need the type converter to create a string representation
3599-
var converter = TypeDescriptor.GetConverter(prop.PropertyType);
3600-
3601-
// Save to an invariant string so that load is not affected by culture
3602-
childElement.SetAttribute(@"Value", converter.ConvertToInvariantString(childObj!));
3603-
}
3598+
// We need the type converter to create a string representation
3599+
var cultureInfo = new CultureInfo("en-US");
3600+
3601+
// We need the type converter to create a string representation
3602+
var converter = TypeDescriptor.GetConverter(prop.PropertyType);
3603+
3604+
// Fix [3164]: "Font property values are not serialized correctly in the exported XML file."
3605+
// Force serialization using the en-US culture to prevent localization issues.
3606+
string? stringValue = string.Empty;
3607+
3608+
if (null != childObj)
3609+
{
3610+
stringValue = converter.ConvertTo(context: null,
3611+
culture: cultureInfo,
3612+
value: childObj!,
3613+
destinationType: typeof(string)) as string;
3614+
}
3615+
3616+
childElement.SetAttribute(@"Value", stringValue ?? string.Empty);
3617+
}
36043618
}
36053619
}
36063620
}

Source/Krypton Components/Krypton.Toolkit/ResourceFiles/ToastNotification/ToastNotificationImageResources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)