I want to localize messages in my Model.
Depending on one property value, another property should have localized values.
I do not know how to inject localizer in a model.
This model is used as a response from API, so using a constructor for that is kind of impossible.
Or I do not have enough knowledge.
`var result = apiHandler.Get<BasePagedResponseModel>(url);
public class OrderLinesModel{
public bool IsApproved {get;set;}
public string Status{
get
{
if (IsApproved)
return “status is approved”;
else
return “status is rejected”;
}
}
}`
This is simple example, I have more cases.
Does anyone have experience with this?
I am using Localizer as it should, works great!
Thanks!
I want to localize messages in my Model. Depending on one property value, another property should have localized values.
I do not know how to inject localizer in a model. This model is used as a response from API, so using a constructor for that is kind of impossible. Or I do not have enough knowledge.
`var result = apiHandler.Get<BasePagedResponseModel>(url);
public class OrderLinesModel{
public bool IsApproved {get;set;} public string Status{ get { if (IsApproved) return “status is approved”; else return “status is rejected”;
} } }`
This is simple example, I have more cases.
Does anyone have experience with this?
I am using Localizer as it should, works great! Thanks!