Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paramaters work as follows #83

Open
suatsuphi opened this issue May 17, 2021 · 0 comments
Open

paramaters work as follows #83

suatsuphi opened this issue May 17, 2021 · 0 comments

Comments

@suatsuphi
Copy link

return new LocalizedString(name, String.Format(localizedString.Value, arguments), localizedString.ResourceNotFound);

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; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant