How to Localize Facet Header in Sitecore
We have a multi language site and we are looking for a simple way for our Content Editors to localize the Facet header title.
You can create a custom facet component called
DictionaryFacet by duplicating the existing CoveoFacet.ascx file and its associated sublayout item (in Web Forms). In that file, you can change the
data-title attribute value for:
data-title='<%= Sitecore.Globalization.Translate.TextByDomain("FacetDictionary", Model.Title) %>'
Then, create a Sitecore dictionary named
FacetDictionary somewhere in your content tree where content editors will be able to define new dictionary entries.
Then, change all your Coveo Facet component instances for Dictionary Facet components. If a dictionary entry exists with a key matching the facet title field value, it will use the translated version from the dictionary at rendering time.
I hope this helps,
Just to make sure I understand properly, here is an example:
You would like to change "Coveo Sites" for "Sites Coveo" if I was loading the interface in French, correct?
When you add the facet to the layout, simply change the title depending on the language version.