SXA Advanced Dictionary

Download the helix foundation project HERE

How do you handle basic content snippets?

google-stop-words
People generally have strong opinions on where simple phrases or single words should be stored in order to properly localize them. This is normally 2 camps.

Store simple content in standard values

One camp that stores simple phrases or single words in the standard values of the templates, this allows for more flexibility on a case by case basis but makes it hard to change them wholesale.

Using stock Dictionaries

The second camp is to use the dictionary, but that comes with it’s own problems, particularly for keeping helix pure and having a component own it’s own Sitecore Items, additionally in SXA you need to worry about utilizing components across different sites and tenants that own a completely different dictionary location.

Either way is not very good

both of these options come with pretty serious problems that place significant tech debt style nastiness on the content authors in terms of flexibility

Enter the AutoDictionary

robot

Automatically creates your dictionary items if they don’t exist.

Allows authors to optionally edit the dictionary items from the EE.

SXA site component sharing automatically handled.

Traditionally a dictionary key will be pathed using .‘s like so:

Carousel.Labels.Next

This would look for the dictionary definition with that key. Traditionally it would be located at the path:

Dictionary/Carousel/Labels/Next

Using this information we know where the dictionary definition SHOULD be.
With the addition of a default text block we can create these dictionary items automatically. whereas a traditional dictionary would output nothing.

<span class="btn">@Html.AutoTranslate("Carousel.Labels.Next", "Next")</span>

The below would be EE authorable

<span class="btn">@Html.AutoTranslate("Carousel.Labels.Next", "Next", true)</span>