1 interface inheriting from IStringLocalizer
Microsoft.Extensions.Localization.Abstractions (1)
IStringLocalizerOfT.cs (1)
10public interface IStringLocalizer<out T> : IStringLocalizer
2 implementations of IStringLocalizer
Microsoft.AspNetCore.Mvc.Localization.Test (1)
TestStringLocalizer.cs (1)
9public class TestStringLocalizer : IStringLocalizer
Microsoft.Extensions.Localization (1)
ResourceManagerStringLocalizer.cs (1)
21public partial class ResourceManagerStringLocalizer : IStringLocalizer
113 references to IStringLocalizer
Aspire.Dashboard (1)
Components\Controls\ApplicationName.razor.cs (1)
19public IStringLocalizer? Loc { get; init; }
LocalizationWebsite (6)
StartupResourcesAtRootFolder.cs (1)
40var stringLocalizer = stringLocalizerFactory.Create("Test", location: location);
StartupResourcesInClassLibrary.cs (4)
36var noAttributeStringLocalizer = stringLocalizerFactory.Create(typeof(ResourcesClassLibraryNoAttribute.Model)); 37var withAttributeStringLocalizer = stringLocalizerFactory.Create(typeof(Alternate.Namespace.Model)); 41var noAttributeNameStringLocalizer = stringLocalizerFactory.Create( 47var withAttributeNameStringLocalizer = stringLocalizerFactory.Create(
StartupResourcesInFolder.cs (1)
43var stringLocalizer = stringLocalizerFactory.Create("Test", assemblyName);
Microsoft.AspNetCore.Mvc.DataAnnotations (28)
AttributeAdapterBase.cs (2)
24/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/> to be used in error generation.</param> 25public AttributeAdapterBase(TAttribute attribute, IStringLocalizer? stringLocalizer)
CompareAttributeAdapter.cs (1)
16public CompareAttributeAdapter(CompareAttribute attribute, IStringLocalizer? stringLocalizer)
DataAnnotationsClientModelValidatorProvider.cs (1)
48IStringLocalizer? stringLocalizer = null;
DataAnnotationsMetadataProvider.cs (3)
97IStringLocalizer? localizer = null; 178IStringLocalizer? enumLocalizer = null; 391private static string GetDisplayName(FieldInfo field, IStringLocalizer? stringLocalizer)
DataAnnotationsModelValidator.cs (3)
17private readonly IStringLocalizer? _stringLocalizer; 24/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/> used to create messages.</param> 30IStringLocalizer? stringLocalizer)
DataAnnotationsModelValidatorProvider.cs (1)
46IStringLocalizer? stringLocalizer = null;
DataTypeAttributeAdapter.cs (1)
16public DataTypeAttributeAdapter(DataTypeAttribute attribute, string ruleName, IStringLocalizer? stringLocalizer)
FileExtensionsAttributeAdapter.cs (1)
16public FileExtensionsAttributeAdapter(FileExtensionsAttribute attribute, IStringLocalizer? stringLocalizer)
IValidationAttributeAdapterProvider.cs (2)
19/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/> which will be used to create messages. 22IAttributeAdapter? GetAttributeAdapter(ValidationAttribute attribute, IStringLocalizer? stringLocalizer);
MaxLengthAttributeAdapter.cs (1)
15public MaxLengthAttributeAdapter(MaxLengthAttribute attribute, IStringLocalizer? stringLocalizer)
MinLengthAttributeAdapter.cs (1)
15public MinLengthAttributeAdapter(MinLengthAttribute attribute, IStringLocalizer? stringLocalizer)
MvcDataAnnotationsLocalizationOptions.cs (2)
18/// The delegate to invoke for creating <see cref="IStringLocalizer"/>. 20public Func<Type, IStringLocalizerFactory, IStringLocalizer> DataAnnotationLocalizerProvider = null!;
RangeAttributeAdapter.cs (1)
16public RangeAttributeAdapter(RangeAttribute attribute, IStringLocalizer? stringLocalizer)
RegularExpressionAttributeAdapter.cs (1)
12public RegularExpressionAttributeAdapter(RegularExpressionAttribute attribute, IStringLocalizer? stringLocalizer)
RequiredAttributeAdapter.cs (2)
19/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/>.</param> 20public RequiredAttributeAdapter(RequiredAttribute attribute, IStringLocalizer? stringLocalizer)
StringLengthAttributeAdapter.cs (1)
16public StringLengthAttributeAdapter(StringLengthAttribute attribute, IStringLocalizer? stringLocalizer)
ValidationAttributeAdapterOfTAttribute.cs (3)
18private readonly IStringLocalizer? _stringLocalizer; 23/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/>.</param> 24public ValidationAttributeAdapter(TAttribute attribute, IStringLocalizer? stringLocalizer)
ValidationAttributeAdapterProvider.cs (1)
20public IAttributeAdapter? GetAttributeAdapter(ValidationAttribute attribute, IStringLocalizer? stringLocalizer)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (21)
CompareAttributeAdapterTest.cs (1)
61var stringLocalizer = new Mock<IStringLocalizer>();
DataAnnotationsMetadataProviderTest.cs (9)
258var sharedLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 296var sharedLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 331var sharedLocalizer = new Mock<IStringLocalizer>(MockBehavior.Loose); 400var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 435var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 499var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 561var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 834var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 1708var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict);
DataAnnotationsModelValidatorTest.cs (2)
372var stringLocalizer = new Mock<IStringLocalizer>(); 516var stringLocalizer = new Mock<IStringLocalizer>();
FileExtensionsAttributeAdapterTest.cs (1)
113var stringLocalizer = new Mock<IStringLocalizer>();
MaxLengthAttributeAdapterTest.cs (2)
29var stringLocalizer = new Mock<IStringLocalizer>(); 117var stringLocalizer = new Mock<IStringLocalizer>();
MinLengthAttributeAdapterTest.cs (1)
29var stringLocalizer = new Mock<IStringLocalizer>();
RangeAttributeAdapterTest.cs (1)
58var stringLocalizer = new Mock<IStringLocalizer>();
RequiredAttributeAdapterTest.cs (1)
30var stringLocalizer = new Mock<IStringLocalizer>();
StringLengthAttributeAdapterTest.cs (1)
28var stringLocalizer = new Mock<IStringLocalizer>();
ValidationAttributeAdapterOfTAttributeTest.cs (2)
22var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Loose); 55public TestValidationAttributeAdapter(TestValidationAttribute attribute, IStringLocalizer stringLocalizer)
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
TestMvcOptions.cs (1)
25var stringLocalizer = new Mock<IStringLocalizer>();
Microsoft.AspNetCore.Mvc.Localization (5)
HtmlLocalizer.cs (4)
9/// An <see cref="IHtmlLocalizer"/> that uses the provided <see cref="IStringLocalizer"/> to do HTML-aware 14private readonly IStringLocalizer _localizer; 19/// <param name="localizer">The <see cref="IStringLocalizer"/> to read strings from.</param> 20public HtmlLocalizer(IStringLocalizer localizer)
HtmlLocalizerFactory.cs (1)
50var localizer = _factory.Create(baseName, location);
Microsoft.AspNetCore.Mvc.Localization.Test (8)
HtmlLocalizerTest.cs (4)
19var stringLocalizer = new Mock<IStringLocalizer>(); 38var stringLocalizer = new Mock<IStringLocalizer>(); 103var stringLocalizer = new Mock<IStringLocalizer>(); 141var stringLocalizer = new Mock<IStringLocalizer>();
MvcLocalizationMvcBuilderExtensionsTest.cs (1)
109var dataAnnotationLocalizerProvider = new Func<Type, IStringLocalizerFactory, IStringLocalizer>((type, factory) =>
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (1)
109var dataAnnotationLocalizerProvider = new Func<Type, IStringLocalizerFactory, IStringLocalizer>((type, factory) =>
ViewLocalizerTest.cs (2)
287private IStringLocalizer _stringLocalizer { get; set; } 289public TestHtmlLocalizer(IStringLocalizer stringLocalizer)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
RemoteAttributeBase.cs (1)
31private IStringLocalizer? _stringLocalizer;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (6)
RemoteAttributeBaseTest.cs (4)
225var localizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 265var localizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 314var localizer = new Mock<IStringLocalizer>(MockBehavior.Strict); 402var localizer = new Mock<IStringLocalizer>(MockBehavior.Strict);
Rendering\HtmlHelperDisplayExtensionsTest.cs (1)
331var stringLocalizer = new Mock<IStringLocalizer>(MockBehavior.Strict);
Rendering\HtmlHelperSelectTest.cs (1)
1303var stringLocalizer = new Mock<IStringLocalizer>();
Microsoft.Extensions.Localization (3)
ResourceManagerStringLocalizer.cs (1)
17/// An <see cref="IStringLocalizer"/> that uses the <see cref="ResourceManager"/> and
ResourceManagerStringLocalizerFactory.cs (2)
122public IStringLocalizer Create(Type resourceSource) 147public IStringLocalizer Create(string baseName, string location)
Microsoft.Extensions.Localization.Abstractions (16)
IStringLocalizerFactory.cs (7)
9/// Represents a factory that creates <see cref="IStringLocalizer"/> instances. 14/// Creates an <see cref="IStringLocalizer"/> using the <see cref="System.Reflection.Assembly"/> and 18/// <returns>The <see cref="IStringLocalizer"/>.</returns> 19IStringLocalizer Create(Type resourceSource); 22/// Creates an <see cref="IStringLocalizer"/>. 26/// <returns>The <see cref="IStringLocalizer"/>.</returns> 27IStringLocalizer Create(string baseName, string location);
IStringLocalizerOfT.cs (1)
7/// Represents an <see cref="IStringLocalizer"/> that provides strings for <typeparamref name="T"/>.
StringLocalizerExtensions.cs (7)
11/// Extension methods for operating on <see cref="IStringLocalizer" /> instances. 18/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/>.</param> 22this IStringLocalizer stringLocalizer, 34/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/>.</param> 39this IStringLocalizer stringLocalizer, 52/// <param name="stringLocalizer">The <see cref="IStringLocalizer"/>.</param> 54public static IEnumerable<LocalizedString> GetAllStrings(this IStringLocalizer stringLocalizer)
StringLocalizerOfT.cs (1)
16private readonly IStringLocalizer _localizer;
Microsoft.Extensions.Localization.RootNamespace.Tests (1)
StringLocalizerOfTRootNamespaceTest.cs (1)
22var valuesLoc = factory.Create(typeof(ValuesController));
Microsoft.Extensions.Localization.Tests (16)
ResourceManagerStringLocalizerFactoryTest.cs (11)
102var result1 = factory.Create(typeof(ResourceManagerStringLocalizerFactoryTest)); 103var result2 = factory.Create(typeof(ResourceManagerStringLocalizerFactoryTest)); 120var result1 = factory.Create(typeof(ResourceManagerStringLocalizerFactoryTest)); 121var result2 = factory.Create(typeof(LocalizationOptions)); 218var result1 = factory.Create("baseName", location); 219var result2 = factory.Create("baseName", location); 237var result1 = factory.Create("baseName1", location); 238var result2 = factory.Create("baseName2", location); 257var result1 = factory.Create("baseName", location1); 258var result2 = factory.Create("baseName", location2); 280var result1 = factory.Create("baseName", location: "Microsoft.Extensions.Localization.Tests");
StringLocalizerOfTTest.cs (5)
40var innerLocalizer = new Mock<IStringLocalizer>(); 57var innerLocalizer = new Mock<IStringLocalizer>(); 75var innerLocalizer = new Mock<IStringLocalizer>(); 92var innerLocalizer = new Mock<IStringLocalizer>(); 110var innerLocalizer = new Mock<IStringLocalizer>();