Localized value for boolean field

How do one get the localized name for the true/false for a boolean field.
We want to display yes/no, ja/nej and not true/false as displayed in backoffice in the Productinformation tab in the product page in our accelerator site.

The accelerator has not special display as for images and fields for boolean field it just displays them with fieldname and value.

Litium version: 7.1.0

Is the field set to MultiCulture = true?

No we have same value for all cultures

backoffice presentation

I could offcource create a websitestring that i displays if true and one if false but i hope that there was another way to use the translations used i backoffice.

Check the Litium.Accelerator.Builders.Product.ProductFieldViewModelBuilder file and the method CreateModel. In this method the fields are added and the partial view to render the value is pointed out.

I think you should write out labels that are created for the public site instead of reusing the resources for the back office translations. The reason is that the back office translations keys can be removed or the value is changed without notice and you don’t want that to be reflected on the public site.

Added this to the ProductFieldViewModelBuilder
if (fieldDefinition.FieldType == SystemFieldTypeConstants.Boolean)
{
var booleanFieldFormatArgs = new FieldFormatArgs { Culture = cultureInfo };
return new ProductFieldViewModel
{
ViewName = “BooleanField”,
Name = fieldDefinition.Localizations[cultureInfo].Name,
Value = fieldFormatter.Format(fieldDefinition, value, booleanFieldFormatArgs),
Args = booleanFieldFormatArgs
};
}
and created a view to handle boolean fields (_BooleanField.cshtml)
@model Litium.Accelerator.ViewModels.ProductFieldViewModel

    @if (!string.IsNullOrEmpty(Model.Value))
    {
        @Model.Name
        <br />
        if (bool.Parse(Model.Value))
         {
             @Html.WebSiteString("product.true.value")
         }
        if (!bool.Parse(Model.Value))
        {
            @Html.WebSiteString("product.false.value")
        }
    }