29Sep, 2022
Introducing the Sitecore Auto Dictionary
I'm excited to release this module, because it has the power to save your team a great deal of development time. By using this in our last Sitecore project I saw a reduction in 220 hours of overall effort, which besides the cost savings incentive, gave us a big win by making things easier for the developers and content team. Introducing, the Sitecore Auto Dictionary!
The Standard Sitecore Dictionary
The Sitecore Dictionary gives you the ability to create a central repository of terms in any number of installed languages for your site. It's great, because our developers can call on that common content instead of creating fields on the contextual items, which would be a nightmare to manage because you'd have duplicated fields everywhere.
Things Get Complex
When a project is underway, the Sitecore developers will usually start to understand what content will be stored in the dictionary instead of the item. When it comes to dictionary items, some of them will be in obvious places like a piece of text in the global footer, but others (like accessibility text) will not. To ensure these new items are seen and reviewed by the content team, developers will send them a message, but a lot of things can get lost along the way.
A Way to Manage Item Creation
Most teams will use a shared control sheet like an Excel workbook, so the developer would add a new dictionary item, what site it's in, its path in the Dictionary, and maybe a context page. There would normally be a column for each language that's being used on the site, and the content team would sign off when they have validated the item and language version. As you can imaging it's ok, but leaves a lot to be desired.

The Auto Dictionary to the Rescue
This module closes the loop between developers and the content team. It will automatically display default text, create the new dictionary item in Sitecore, compile a list of items what were created, and notify the content team by using an authorable email template. This removes the need for direct communication about these items, and any kind of spreadsheet.
How Does It Work?
Glad you asked. Let's start from the beginning. This is what the site would usually display when the dictionary items are not complete. You can see only the keys are exposed.

At this stage a developer would usually look at mock ups an see what text is to be shown, but this is rarely finalized copy and will almost certainly be unilingual. So, they know the gist of the content but it's not production-ready. They use the Auto Dictionary module instead of using the Sitecore one, providing two additional (optional) parameters. An example of this would be:
Translate.Text("demo.site", "Global/Branding", "Demo Site")
Here, demo.site is the key (same as Sitecore), Global/Branding would be the path to the new item, and Demo Site is the default text to be shown. This is done for every dictionary item, and the result is:

As you can see it's a more pleasant experience, but it doesn't stop there. In Sitecore, the module figures out if the Dictionary Domain was created, and does so if it's not there yet. It also creates the necessary Dictionary folder items and Dictionary entries. In the event an alternate language is used, it checks to see if the item it there a just needs a version added, which is also done automatically. So in this example, everything under Dictionary was just created automatically:

When complete, the necessary items are published, and then the notice is emailed to the team, by using an authorable template.
The following items have been created and published in your Sitecore Dictionary, and should be reviewed by the content team.
New Item: /sitecore/system/dictionary/site1/Branding/demo site
Key: demo.site
Value/Text: Demo Site
Language: en
Page/Url: https://demo-cd.mnp.ca/
New Item: /sitecore/system/dictionary/site1/Branding/coffee house
Key: coffee.house
Value/Text: Coffee House
Language: en
Page/Url: https://demo-cd.mnp.ca/
New Item: /sitecore/system/dictionary/site1/Branding/demo site
Key: demo.site
Value/Text: Demo Site
Language: fr
Page/Url: https://demo-cd.mnp.ca/fr
New Item: /sitecore/system/dictionary/site1/Branding/coffee house
Key: coffee.house
Value/Text: Coffee House
Language: fr
Page/Url: https://demo-cd.mnp.ca/fr
Under the Hood
In my next post, I'll go over the entire module's process, which also includes some measures to ensure there are no unnecessary calls to the database in case of a high-volume environment.