I would like to display Yes/No in different languages according to some boolean variable. Is there a generic way to format it according to the locale passed to it? I
in my razor page is working this: @(item.Active.GetValueOrDefault() ? "Yes" : "No")
@(item.Active.GetValueOrDefault() ? "Yes" : "No")
here is important if attribute is required (nullable) or not, if is required it should be good with:
@(item.Active ? "Yes":"No")
I found this here on some other post, just replaying, hope it helps some1.