Reputation: 7074
I have a custom wizard control that I am modifying with a Title and a SubTitle. How do I save and localize strings in the control? Here is the SubTitle property:
[Category("Appearance"), DefaultValue("Description for the new page."), Description("The subtitle of the page."), Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
public string Subtitle
{
get { return subtitle; }
set
{
if (subtitle != value)
{
Region regionToInvalidate = GetTextRegionToInvalidate();
subtitle = value;
regionToInvalidate.Union(GetTextRegionToInvalidate());
Invalidate(regionToInvalidate);
}
}
}
Upvotes: 2
Views: 771
Reputation: 11059
Just add the Localizable attribute
[Category("Appearance"), DefaultValue("Description for the new page."), Description("The subtitle of the page."), Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
[Localizable(true)]
public string Subtitle
{
get { return subtitle; }
set
{
if (subtitle != value)
{
Region regionToInvalidate = GetTextRegionToInvalidate();
subtitle = value;
regionToInvalidate.Union(GetTextRegionToInvalidate());
Invalidate(regionToInvalidate);
}
}
}
Upvotes: 3