Purpose of this articles is to explain a problem I recently faced while using Sitecore Dictionary Items and how I fixed the issue. The Sitecore Dictionary item is very useful when you want controls to display content in different languages depending on the current language (Sitecore.Context.Language).
Although the use of the dictionary items looks very straight forward, I initially bumped into a small problem. My problem was that, all the dictionary item on the websites were displaying values from KEY instead of PHRASE text. I tried the below actions, but the issue still existed.
- Clear Sitecore cache
- Remove Dictionary.dat file from webroot/temp/ folder.
- App Pool recycle.
- Publish dictionary items and its descendants.
- ResetCache (Sitecore.Globalization.Translate.ResetCache(true))
After further investigation, I was able to find the cause of the issue and the problem seem to be the value of dictionary domain attribute in the Site definition config file – we have provided same name for two different Site Dictionary domain item and referred the same name in two different sites in site definition config, because of which Sitecore was not able to resolve the correct dictionary domain for the Site.
I found two alternative solution to resolve this issue :
- Provide the GUID of dictionary domain in the Site definition config
- Rename the dictionary domain, so that no two sites has the same dictionary domain name in the Site definition config.