Hello.
This replacement could be done for example in the WebPartCategoryInfo.TYPEINFO.Events.Insert.Before event. Or, in general, you could use any proper object event handler as described here.
For the WebPartCategoryInfo.TYPEINFO.Events.Insert.Before event, the logic could look like this:
WebPartCategoryInfo.TYPEINFO.Events.Insert.Before += WebPartCategoryInfo_Insert_Before;
private void WebPartCategoryInfo_Insert_Before(object sender, ObjectEventArgs e)
{
if (e.Object != null)
{
// no object provided
return;
}
var webPartCategory = (WebPartCategoryInfo)e.Object;
webPartCategory.CategoryName = webPartCategory.CategoryName.Replace("_", "-");
}
Hope it helps.
Best regards,
Radek Macalik
, Kentico support