In my last post I went over how to create your own custom dictionary for RadSpell and since this control is fully integrated into our RadEditor control I wanted to discuss how to use your custom dictionary with the RadEditor, as well as how to localize the RadEditor itself.
To start off we want to make sure that we can take use of our custom dictionary in the RadEditor. To do this we need to make sure that the “RadSpell” folder is located in the “App_Data” folder of our project. In the RadSpell folder we have to add all of our custom dictionaries (in this case just good ole’ Test.tdf) that we want to take use of.
We then have to make sure that we have the SpellCheck handler in our web.config. If you have used our Visual Studio Extensions to either upgrade a project or used one of our templates to create a Telerik-enabled project from scratch then this should already be registered. In the “httpHandlers” section the following line should be included:
Once we select the language the spell checker will now go through our content. As I mentioned before it will be fairly easy to see how the RadEditor’s RadSpell handles words that do not exist in the dictionary used:
Each word that is not in the dictionary will be highlighted in yellow, and for each word the spell checker will go through asking if you want to ignore, change manually or add to the dictionary. If you choose to add to the dictionary the word will now be available the next time you use the RadEditor!
If you are looking to really provide your users with a fully localized RadEditor then you will want to look into using resource files. As with the dictionaries the only resource files that Telerik officially supports are English, French and German. However, we do have a long list of user contributed resource files that are all posted in this forum thread. These can all be opened and edited in Visual Studio – so if you download one of these resource files and find strings you are not completely happy with you can always go in and edit them yourselves.
So what do you do if you find that your particular language is not in the list of available languages? The answer might be a bit time consuming, but it is fairly simple – create your own! The way to go about this is to download the default RadEditor resource files which you can find a zip of here. The files contained in this zip are:
In order for you to be able to use these resource files you will have to add them to the App_GlobalResources folder. If you are unable to use this folder you will have to define where the RadEditor should find the resource files using the LocalizationPath property. Once you have added these files you will have to create duplicates of each file in order to start the translation process. The RadEditor needs copies of both the original resource files as well as your customized ones in order to be localized. The naming convention of the new resource files should be as follows:
For a sample of what this will look take a look at this image:
As you can see here, I have all of the default resource files as well as copies for sv-SE which stands for the Swedish language spoken in Sweden.
Now we can start the translation process. All you have to do is double-click on the resource file you want to start translating (in my case RadEditor.Main.sv-SE.resx) and you will see the following:
What you need to change is the “Value” field of this file. The “Name” field will remain unchanged as this is what the RadEditor needs to figure out what localization string goes where. Luckily for me the translation to Swedish has already been taken care of, and for the most part I do agree with the translations. If you’re the first one to translate these strings into your language please feel free to share this with the community via the RadEditor forum.
Once you have gone through all of these value fields and translated them properly you can now go ahead and localize your RadEditor by setting the “Language” property of the RadEditor:
Iana Tsolova is Product Manager at Telerik’s DevTools division. She joined the company back in the beginning of 2008 as a Support Officer and has since occupied various positions at Telerik, including Senior Support Officer, Team Lead at one of the ASP.NET AJAX teams and Technical Support Director. Iana’s main interests are web development, reading articles related to geography, wild nature and latest renewable energy technologies.
Subscribe to be the first to get our expert-written articles and tutorials for developers!