From 13c32f1a49f0b0f4a1b19cdd4e9a4cde0a83c7b3 Mon Sep 17 00:00:00 2001 From: Tony Han Date: Wed, 8 May 2024 13:33:20 +0800 Subject: [PATCH] remove localize --- .../RecipeSteps/ContentDefinitionStep.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs index 1ec337d8854..d95309fa421 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs @@ -1,7 +1,6 @@ using System; using System.Text.Json.Nodes; using System.Threading.Tasks; -using Microsoft.Extensions.Localization; using OrchardCore.ContentManagement.Metadata; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentManagement.Metadata.Records; @@ -16,12 +15,10 @@ namespace OrchardCore.ContentTypes.RecipeSteps public class ContentDefinitionStep : IRecipeStepHandler { private readonly IContentDefinitionManager _contentDefinitionManager; - protected readonly IStringLocalizer S; - public ContentDefinitionStep(IContentDefinitionManager contentDefinitionManager, IStringLocalizer s) + public ContentDefinitionStep(IContentDefinitionManager contentDefinitionManager) { _contentDefinitionManager = contentDefinitionManager; - S = s; } public async Task ExecuteAsync(RecipeExecutionContext context) @@ -63,7 +60,7 @@ private Task UpdateContentTypeAsync(ContentTypeDefinition type, ContentTypeDefin { if (string.IsNullOrEmpty(part.PartName)) { - throw new InvalidOperationException(S["Unable to add content-part to the '{0}' content-type. The part name cannot be null or empty.", type.Name]); + throw new InvalidOperationException($"Unable to add content-part to the '{type.Name}' content-type. The part name cannot be null or empty."); } builder.WithPart(part.Name, part.PartName, partBuilder => partBuilder.MergeSettings(part.Settings));