Does SXA have out of the box support (i.e. some API method to call) for Dictionary text stored at a per-site level? If so, how is this enabled?
1 Answer
In Sitecore 9.3 when you create a new site you will find a Dictionary node in it. This works like the ootb Sitecore dictionary and includes fallback to more generic dictionaries (you can set which ones).
Reading values from this dictionary can be done with Scriban with the sc_translate
function. More info here: https://ggullentops.blogspot.com/2019/11/sitecore-sxa-93-scriban.html
If you are not on 9.3, you could use the solution Kamruz mentioned or go custom.. For an older project I created a custom variant that could handle translations. Creating the variant can be found here: https://ggullentops.blogspot.com/2019/04/sitecore-sxa-custom-rendering-variant-translation.html. You do need to link this variant to a translation mechanism - in our case that was custom too, but out of scope for that blog post. You could link it to any code that can translate labels though.
dictionaryDomain
attribute on the site node entry (and use domain fallback if you want). Worth bearing in mind for variants.