1

Firstly, are Umbraco dictionary Items cached? If they are, how do you change the cache settings?

Secondly, is there any way in which we can regenerate list of existing dictionary items with a new prefix?

For example, if I have dictionary items with the following names

  1. Dic_one
  2. Dic_two
  3. Dic_three
  4. Dic_four

Now I need to add a prefix, such as UK_, and I need to copy the respective Umbraco dictionary items without losing their previous values:

  1. UK_Dic_one
  2. UK_Dic_two
  3. UK_Dic_three
  4. UK_Dic_four

How could I add this prefix, while still keeping the rest of the values in the dictionary?

Owen Blacker
  • 4,117
  • 2
  • 33
  • 70
BJ Patel
  • 6,148
  • 11
  • 47
  • 81

2 Answers2

3

Dictionary items by itself are not cached, though they are part of either a macro or a template which can cached (on the macro itself, or via IIS caching).

The existing dictionary items are stored in the table cmsDictionary, which you can get with the following SQL

SELECT [pk]
      ,[id]
      ,[parent]
      ,[key]
  FROM [dbo].[cmsDictionary]

From there it is just a matter of updating the existing "key" value with a prefix.

As far as the "UK" prefix goes, this is a bit strange as dictionary keys can have different languages assigned to them. Having a dictionary item UK_Dic_One with a Dutch value would be a bit confusing, that would better be solved by adding different languages and using nested dictionary items (dictionary items can be nested in version 6).

If you can add new dictionary items, I would recommend the Dictionary Dashboard that allows you to export/import and edit an XML file with dictionary items which then can be imported afterwards.

Astuanax
  • 667
  • 5
  • 18
0

I had the same issue. As @astuanax mentioned they are cached on template level. I was able to clear the "cache" by touching the web.config and restart the apppool.

NinjaOnSafari
  • 998
  • 1
  • 8
  • 32
  • **What?** I've got the same issue. I've created a tool that's let's the user edit the dictionary items by itself using Excel files. I think restarting the apppool is a bad idea because if the will translate the hole dictionary in bulk _(more or less 600 items)_, it goes realy slow and they will restart the website again and again _(in case of a not technical user)_. There must be an way to clear the cache on template level by writing code. – H. Pauwelyn Jul 03 '18 at 09:18