Skip to content

Commit

Permalink
Fix loc'ble attributes resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
RussKie committed May 14, 2021
1 parent 73affb7 commit 2d30e86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/System.Windows.Forms.Design/src/SRCategoryAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ namespace System.Windows.Forms
[AttributeUsage(AttributeTargets.All)]
internal sealed class SRCategoryAttribute : CategoryAttribute
{
public SRCategoryAttribute(string category) : base(category)
public SRCategoryAttribute(string category)
: base(category)
{
}

protected override string GetLocalizedString(string value)
{
return value;
}
protected override string GetLocalizedString(string value) => SR.GetResourceString(value);
}
}
5 changes: 3 additions & 2 deletions src/System.Windows.Forms.Design/src/SRDescriptionAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ internal sealed class SRDescriptionAttribute : DescriptionAttribute
{
private bool replaced;

public SRDescriptionAttribute(string description) : base(description)
public SRDescriptionAttribute(string description)
: base(description)
{
}

Expand All @@ -22,7 +23,7 @@ public override string Description
if (!replaced)
{
replaced = true;
DescriptionValue = base.Description;
DescriptionValue = SR.GetResourceString(base.Description);
}

return base.Description;
Expand Down
5 changes: 3 additions & 2 deletions src/System.Windows.Forms.Design/src/SRDisplayNameAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ internal sealed class SRDisplayNameAttribute : DisplayNameAttribute
{
private bool replaced;

public SRDisplayNameAttribute(string displayName) : base(displayName)
public SRDisplayNameAttribute(string displayName)
: base(displayName)
{
}

Expand All @@ -22,7 +23,7 @@ public override string DisplayName
if (!replaced)
{
replaced = true;
DisplayNameValue = base.DisplayName;
DisplayNameValue = SR.GetResourceString(base.DisplayName);
}

return base.DisplayName;
Expand Down

0 comments on commit 2d30e86

Please sign in to comment.