Open JanneHarju opened 5 years ago
will be released in next version
We're in April 2021, three versions later, but this issue still hasn't been fixed. Is there any chance this will get fixed soon ?
Hi @daniel-jann I'll look at this again. Maybe if you know how to fix it, you could do a PR?
I don't have so much time at the moment
Greetings Damien
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; }
It seems that second version of _localizer["Thing {jep}", jep] is not using arguments at all. https://github.com/damienbod/AspNetCoreLocalization/blob/master/src/Localization.SqlLocalizer/DbStringLocalizer/SqlStringLocalizer.cs#L36 Is there something I need to know about C# or is this just in todo phase. I believe that there should be few more lines in that method like this.