1

We have upgraded our website from Sitecore 8.2.4 to Sitecore 9.0.2. While on a local standalone environment the dictionary items are translated as expected, on a scaled environment (1 CM and 1 CD) the keys are being shown instead of phrases. Basically in order to fix this issue, I remove the temp/dictionary.bat file and I republish the

/sitecore/system/Dictionary

folder with sub-items. This fixes the dictionary labels translation for a few hours, maximum one day, then the keys are being shown again.

Did anyone experience this issue?

1 Answer 1

2

This is an old issue which I could replicate on some solution of Sitecore 8 but it's strage is still on Sitecore 9.

On events <event name="publish:end"> and <event name="publish:end:remote"> you need to add a new handler for reseting dictionary cache :

<event name="publish:end">
  <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
   <sites hint="list">
     <site>website</site>
    </sites>
 </handler>
 <handler type="Yournamespace,DictionaryCacheClearer, yourAssembly" method="ClearCache"/>
</event>

<event name="publish:end:remote">
  <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
     <sites hint="list">
      <site>website</site>
     </sites>
   </handler>
   <handler type="Yournamespace,DictionaryCacheClearer, yourAssembly" method="ClearCache"/>
   </event>

Your class will be :

public class DictionaryCacheClearer
{
   public void ClearCache(object sender, EventArgs args)
   {
     Translate.ResetCache();
     Log.Info("Dictionary cache cleared", this);
   }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.