Skip to content

Commit b22f8a0

Browse files
committed
Remove generic type suffix properly
1 parent 227331b commit b22f8a0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Oqtane.Client/Modules/Controls/LocalizableComponent.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ protected IStringLocalizer T
3232
var controlTypeName = controlType.Name;
3333
var assemblyName = controlType.Assembly.GetName().Name;
3434

35-
// Trim "`1" suffix (for generic type) to make it consistent like normal control types
36-
if (controlTypeName.EndsWith("`1"))
35+
if (controlType.IsGenericType)
3736
{
38-
controlTypeName = controlTypeName.TrimEnd('`', '1');
37+
// Trim generic type suffix
38+
controlTypeName = controlTypeName[..controlTypeName.IndexOf('`')];
3939
}
4040

4141
controlTypeName = controlType.FullName[..(controlType.FullName.IndexOf(controlTypeName) + controlTypeName.Length)];

0 commit comments

Comments
 (0)