33 instantiations of LocalizedString
Aspire.Dashboard.Tests (2)
Model\TestStringLocalizer.cs (2)
10public LocalizedString this[string name] => new LocalizedString(name, $"Localized:{name}"); 11public LocalizedString this[string name, params object[] arguments] => new LocalizedString(name, $"Localized:{name}:" + string.Join("+", arguments));
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (16)
CompareAttributeAdapterTest.cs (1)
67.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
DataAnnotationsMetadataProviderTest.cs (7)
261.Returns(new LocalizedString("DisplayNameValue", "Name from DisplayNameAttribute")); 299.Returns(new LocalizedString("DisplayNameValue", "Name from DisplayNameAttribute")); 564.Returns(() => new LocalizedString("Model_Name", "name from localizer " + CultureInfo.CurrentCulture)); 567.Returns(() => new LocalizedString("Model_Description", "description from localizer " + CultureInfo.CurrentCulture)); 570.Returns(() => new LocalizedString("Model_Prompt", "prompt from localizer " + CultureInfo.CurrentCulture)); 837.Returns<string>((index) => new LocalizedString(index, index + " value")); 1713return new LocalizedString(k, $"{k} {CultureInfo.CurrentCulture}");
DataAnnotationsModelValidatorTest.cs (1)
371var localizedString = new LocalizedString(attribute.ErrorMessage, "Longueur est invalide : 4");
FileExtensionsAttributeAdapterTest.cs (1)
116.Returns(new LocalizedString(attribute.ErrorMessage, expectedErrorMessage));
MaxLengthAttributeAdapterTest.cs (2)
31.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage)); 116var localizedString = new LocalizedString(errorKey, "Longueur est invalide");
MinLengthAttributeAdapterTest.cs (1)
31.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
RangeAttributeAdapterTest.cs (1)
61.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
RequiredAttributeAdapterTest.cs (1)
32.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
StringLengthAttributeAdapterTest.cs (1)
32.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
Microsoft.AspNetCore.Mvc.Localization.Test (8)
HtmlLocalizerTest.cs (4)
18var localizedString = new LocalizedString("Hello", "Bonjour"); 36var localizedString = new LocalizedString("Hello", "Bonjour test"); 101var localizedString = new LocalizedString("Hello", format); 139var localizedString = new LocalizedString("Hello", format);
TestStringLocalizer.cs (4)
32return new LocalizedString(name, value + name); 52return new LocalizedString(name, value + name + argument); 59allStrings.Add(new LocalizedString("Hello", "World")); 63allStrings.Add(new LocalizedString("Foo", "Bar"));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (4)
RemoteAttributeBaseTest.cs (2)
264var localizedString = new LocalizedString("Fred", expected); 401var localizedString = new LocalizedString("Fred", expected);
Rendering\HtmlHelperDisplayExtensionsTest.cs (1)
336return new LocalizedString(key, "created from IStringLocalizer");
Rendering\HtmlHelperSelectTest.cs (1)
1306.Returns<string>((s) => { return new LocalizedString(s, s + " " + CultureInfo.CurrentCulture); });
Microsoft.Extensions.Localization (3)
ResourceManagerStringLocalizer.cs (3)
107return new LocalizedString(name, value ?? name, resourceNotFound: value == null, searchedLocation: _resourceBaseName); 121return new LocalizedString(name, value, resourceNotFound: format == null, searchedLocation: _resourceBaseName); 146yield return new LocalizedString(name, value ?? name, resourceNotFound: value == null, searchedLocation: _resourceBaseName);
76 references to LocalizedString
Aspire.Dashboard.Tests (3)
Model\TestStringLocalizer.cs (3)
10public LocalizedString this[string name] => new LocalizedString(name, $"Localized:{name}"); 11public LocalizedString this[string name, params object[] arguments] => new LocalizedString(name, $"Localized:{name}:" + string.Join("+", arguments)); 13public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) => [];
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
DataAnnotationsModelValidatorTest.cs (1)
371var localizedString = new LocalizedString(attribute.ErrorMessage, "Longueur est invalide : 4");
MaxLengthAttributeAdapterTest.cs (1)
116var localizedString = new LocalizedString(errorKey, "Longueur est invalide");
Microsoft.AspNetCore.Mvc.Localization (21)
HtmlLocalizer.cs (9)
50public virtual LocalizedString GetString(string name) 58public virtual LocalizedString GetString(string name, params object[] arguments) 66public virtual IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) => 70/// Creates a new <see cref="LocalizedHtmlString"/> for a <see cref="LocalizedString"/>. 72/// <param name="result">The <see cref="LocalizedString"/>.</param> 73protected virtual LocalizedHtmlString ToHtmlString(LocalizedString result) => 77/// Creates a new <see cref="LocalizedHtmlString"/> for a <see cref="LocalizedString"/>. 79/// <param name="result">The <see cref="LocalizedString"/>.</param> 81protected virtual LocalizedHtmlString ToHtmlString(LocalizedString result, object[] arguments) =>
HtmlLocalizerExtensions.cs (1)
47public static IEnumerable<LocalizedString> GetAllStrings(this IHtmlLocalizer htmlLocalizer)
HtmlLocalizerOfT.cs (3)
49public virtual LocalizedString GetString(string name) 57public virtual LocalizedString GetString(string name, params object[] arguments) 65public virtual IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) =>
IHtmlLocalizer.cs (5)
34/// <returns>The string resource as a <see cref="LocalizedString"/>.</returns> 35LocalizedString GetString(string name); 42/// <returns>The formatted string resource as a <see cref="LocalizedString"/>.</returns> 43LocalizedString GetString(string name, params object[] arguments); 52IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures);
ViewLocalizer.cs (3)
65public LocalizedString GetString(string name) => _localizer.GetString(name); 68public LocalizedString GetString(string name, params object[] values) => _localizer.GetString(name, values); 71public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) =>
Microsoft.AspNetCore.Mvc.Localization.Test (23)
HtmlLocalizerTest.cs (6)
18var localizedString = new LocalizedString("Hello", "Bonjour"); 36var localizedString = new LocalizedString("Hello", "Bonjour test"); 101var localizedString = new LocalizedString("Hello", format); 139var localizedString = new LocalizedString("Hello", format); 165var actualLocalizedString = htmlLocalizer.GetString("John"); 180var actualLocalizedString = htmlLocalizer.GetString("John", "Doe");
MvcLocalizationServiceCollectionExtensionsTest.cs (6)
79public LocalizedString GetString(string name) 84public LocalizedString GetString(string name, params object[] arguments) 89public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) 108public LocalizedString GetString(string name) 113public LocalizedString GetString(string name, params object[] arguments) 118public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)
TestStringLocalizer.cs (4)
22public LocalizedString this[string name] 36public LocalizedString this[string name, params object[] arguments] 56public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) 58var allStrings = new List<LocalizedString>();
ViewLocalizerTest.cs (7)
183var actualLocalizedString = viewLocalizer.GetString("John"); 207var actualLocalizedString = viewLocalizer.GetString("John", "Doe"); 298var localizedString = _stringLocalizer.GetString(name); 310var localizedString = _stringLocalizer.GetString(name, arguments); 319public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) 330public LocalizedString GetString(string name) 335public LocalizedString GetString(string name, params object[] arguments)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
RemoteAttributeBaseTest.cs (2)
264var localizedString = new LocalizedString("Fred", expected); 401var localizedString = new LocalizedString("Fred", expected);
Microsoft.Extensions.Localization (4)
ResourceManagerStringLocalizer.cs (4)
99public virtual LocalizedString this[string name] 112public virtual LocalizedString this[string name, params object[] arguments] 126public virtual IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) => 135protected IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures, CultureInfo culture)
Microsoft.Extensions.Localization.Abstractions (18)
IStringLocalizer.cs (5)
17/// <returns>The string resource as a <see cref="LocalizedString"/>.</returns> 18LocalizedString this[string name] { get; } 25/// <returns>The formatted string resource as a <see cref="LocalizedString"/>.</returns> 26LocalizedString this[string name, params object[] arguments] { get; } 35IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures);
LocalizedString.cs (5)
16/// Creates a new <see cref="LocalizedString"/>. 26/// Creates a new <see cref="LocalizedString"/>. 37/// Creates a new <see cref="LocalizedString"/>. 55/// Implicitly converts the <see cref="LocalizedString"/> to a <see cref="string"/>. 59public static implicit operator string?(LocalizedString localizedString)
StringLocalizerExtensions.cs (5)
20/// <returns>The string resource as a <see cref="LocalizedString"/>.</returns> 21public static LocalizedString GetString( 37/// <returns>The formatted string resource as a <see cref="LocalizedString"/>.</returns> 38public static LocalizedString GetString( 54public static IEnumerable<LocalizedString> GetAllStrings(this IStringLocalizer stringLocalizer)
StringLocalizerOfT.cs (3)
30public virtual LocalizedString this[string name] 41public virtual LocalizedString this[string name, params object[] arguments] 52public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) =>
Microsoft.Extensions.Localization.Tests (3)
ResourceManagerStringLocalizerTest.cs (3)
110var value = localizer["name"]; 136var value = localizer["a key!"]; 169var value = Assert.Single(strings);