AspNetCoreLocalization icon indicating copy to clipboard operation
AspNetCoreLocalization copied to clipboard

paramaters work as follows

Open suatsuphi opened this issue 4 years ago • 0 comments

https://github.com/damienbod/AspNetCoreLocalization/blob/a362dc73be13cdfb2ee83bd1a8fa9b440ea00e74/src/Localization.SqlLocalizer/DbStringLocalizer/SqlStringLocalizer.cs#L41

parameters work as follows

using System.Linq;
public LocalizedString this[string name, params object[] arguments]
        {
            get
            {
                var localizedString = this[name];
                return new LocalizedString(name, String.Format(localizedString.Value, arguments.Select(x => x.ToString()).ToArray()), localizedString.ResourceNotFound);
            }
        }
new LocalizationRecord(){ Key="RequiredError", ResourceKey="global", Text="The {0} field is required.", LocalizationCulture="en-GB" },
new LocalizationRecord(){ Key="Name", ResourceKey="global", Text="Name", LocalizationCulture="en-GB" },

[Required(ErrorMessage = "RequiredError")]
[Display(Name = "Name")] 
public string Name { get; set; }

suatsuphi avatar May 17 '21 00:05 suatsuphi