October 12, 2010 by Alistair Deneys
I recently ran into an issue with Sitecore where the dictionary I’d configured for a language was being ignored. Whenever you create a new language in Sitecore a language definition item corresponding to the language is created at
/sitecore/system/Languages/[language code]. One of the fields of this language definition item is “dictionary” and is filled in with the filename of the TDF file used by the Telerik editor to perform spell checking in rich text fields. The issue was Sitecore was ignoring this field value and using a different dictionary. I could see this issue because no matter what value I put into that field a US English dictionary was always used to spell check the rich text fields.
The reason this issue came to light was that I was trying to configure Sitecore for the Australian locale. I did this by:
- Change the flag icon for the default
enlanguage from American to Australian
- Configure the
- Change the dictionary value for the language definition item to
But it would appear changing the dictionary field has no effect. Sitecore was ignoring that value and instead tried to load an appropriate dictionary for
en language in Sitecore is a neutral culture meaning it doesn’t define a region and doesn’t define region specific formatting rules for numbers and dates. For example, in Australia dates are formatted dd/MM/yy whereas in America dates are formatted MM/dd/yy. Both cultures speak English though (albeit slightly different spelling rules (color vs colour)).
So Sitecore can do things like format dates, etc it requires a specific culture. The .net framework exposes a method on the
System.Globalization.CultureInfo class called
CreateSpecificCulture. You can pass a neutral culture to this method and .net will look up for the first installed language on the system which has the same language as the neutral one requested. In most cases for
en this will be
So the rich text editor field was loading a dictionary based on the current language name,
en, which resulted in the US English dictionary being loaded. I logged this issue with Sitecore support and they’ve confirmed it as a bug. This is good cause it means Sitecore should be fixing the issue, hopefully quite soon.
There are a few workarounds for this issue.
- Contact Sitecore Support for a workaround. They provided it to me and I know of at least one other SDN Forum user who also received the workaround.
- Rename the dictionary file to en-US.tdf (not desirable as it means you won’t be able to spell check in US English)
- Configure the correct specific language in Sitecore before you start content authoring.
The third workaround above isn’t likely to happen as by the time you’ve realised there is an issue with the spell checking dictionary you’ve likely already created some content. So I got to wondering if I could use Revolver to migrate my existing
en language content to the new specific language I created?
Revolver contains the
cpl command (copy language) which is used to copy content between languages. I could easily couple that with a
find command to traverse every single item in the system and copy the content over. I could then hopefully delete the default
This may also be desirable for those that never enter English content into their websites. For example, if I were in Italy creating an Italian only site, what’s the point of having this English language hanging around?
But I thought I should test this idea to make sure it worked. I grabbed an existing Sitecore 6.3 install I had hanging around, added the
en-AU language then executed the following command in Revolver to copy all the content from
find -r (cpl en-AU)
I also threw a timer around that to see how long it would take.
timer (find -r (cpl en-AU))
For the master DB containing 2086 items this took 132 seconds. But the real test here is to see if I can now delete the default
en language and have Sitecore work properly.
So off to the control panel I go to delete the
en language…and everything appears to be working properly. Just remember to set your site’s language or the
DefaultLanguage setting in