Sitecore Dictionary items showing Key instead of Phrase text

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.

siteconfig

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s