Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

DbLocalizationProvider - Load label text for commerce catalog

Vote:
 

Hello @all,

I am fairly new to the Episerver/Optimizely universe and this is my first post in this forum. I would really appreciate some help on this topic. 

Currently we are using the DbLocalizationProvider as add-on for our solution as a simple way to provide ressources and translations for our project. There also seems to be an integration to load the tooltip text for catalog fields in the commerce catalog from the DbLocalizationProvider - this is implemented in the following way:

[LocalizedModel(KeyPrefix = "/contenttypes/ProductVariationContent/", OnlyIncluded = true)]
    public abstract class ProductVariationContent 
    {
        ....

        [Display(Name = "Producttype", GroupName = SystemTabNames.Settings, Order = 1)]
        [UIHint(UiHintConstants.ProductTicketType )]
        [Include]
        [ResourceKey("properties/ProductTicketType/help", "Producttype")]
        public virtual int ProductTicketType { get; set; }
    }

The key for this to work is the /help RessourceKey, because of this ressource the text for the tooltip in the commerce catalog is queried from the DbLocalizationProvider database. Now we would like to implement the feature that not only the tooltip text but also the label text for a catalog field in the commerce catalog is queried from the DbLocalizationProvider database.

Of course I was hoping that there is a similar way to load the label text, like the tooltip text from the database.

Does anyone know? Is this possible? Does a similar way exists, maybe by defining a special ResourceKey (like for the tooltip text) so the label texts are also loaded from the database?

I appreciate your help,

Greetings Florian 

#256160
Jun 07, 2021 10:56
valdis - Jun 08, 2021 5:31
Are you referring to Catalog UI editors - when editing entities from the catalog? Or content (product / variation) type editors?
Vote:
 

I am referring to the Catalog UI editors - when editing entitites from the catalog. Do you maybe know a way to achieve it for this editor?

BR

#256218
Jun 08, 2021 6:57
Vote:
 

Try looking at override DataAnnotationsModelMetadataProvider to feed the Display attribute with your custom source.

#258484
Jul 05, 2021 22:19
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.