The built-in localization mechanism in Silverlight and WPF allows you to localize any string resource used by the RadSpellChecker control. Once translated you might use your resources in both Silverlight and WPF projects without changing anything. You can find more information on the localization of the Telerik UI Suite here.

There are two ways to implement the localization - using Resource files or a custom localization manager.

You can base your localization on the standard resource files provided by the .NET framework. For that purpose you will have to create a separate .ResX file for each one of the languages that your application will support. Imagine that you want to translate your application into English, German and Dutch. In that regard, you will have to add three new resource files to your project:

RadSpellChecker.resx - this resource file will store the English (default) resources for the spell-checker control. Set the AccessModifier property to Public.

RadSpellChecker.de.resx - this resource file will store the German resources for the spell-checker control. Set the AccessModifier property to No code generation.

RadSpellChecker.nl.resx - this resource file will store the Dutch resources for the spell-checker control. Set the AccessModifier property to No code generation.

Here is the complete list of RadSpellChecker-related Resource Keys, which you should include in each of the resource files:

Documents_SpellCheckingDialog_Header

Documents_SpellCheckingDialog_NotInDictionary

Documents_SpellCheckingDialog_IgnoreAll

Documents_SpellCheckingDialog_AddToDictionary

Documents_SpellCheckingDialog_ChangeTo

Documents_SpellCheckingDialog_Change

Documents_SpellCheckingDialog_Suggestions

Documents_SpellCheckingDialog_EditCustomDictionary

Documents_SpellCheckingDialog_SpellingCheckIsComplete

Ok

Cancel

SpellChecker_SpellingCheckIsCompleteMessageHeader

SpellChecker_SpellingCheckIsCompleteMessage

Documents_EditCustomDictionaryDialog_Header

Documents_EditCustomDictionaryDialog_Word

Documents_EditCustomDictionaryDialog_Dictionary

Documents_EditCustomDictionaryDialog_Add

Documents_EditCustomDictionaryDialog_Delete

Documents_EditCustomDictionaryDialog_DeleteAll

Documents_EditCustomDictionaryDialog_DeleteAllMessageHeader

Documents_EditCustomDictionaryDialog_DeleteAllMessage

Close

The three files should keep the same resource keys, whereas the values must be the translated ones.

The last step is to instantiate the LocalizationManager class and set its ResourceManager to the resources that have been just created.

If you rely on culture settings to load the right resources automatically, you have to write some code inside your application's project file. For example, if you have to support English and Dutch languages, you can store the localized strings in Resources.resx and Resources.nl.resx files. For the Resources.resx file you can set ResXFileCodeGenerator to Internal or Public and for others to No code generation. Then, open the project file in a text-mode and insert the code below into the section. In this way you notify the framework about the supported cultures.

Telerik.Windows.Controls.LocalizationManager allows you to easily localize any of the Telerik controls. To apply custom localization to your controls, just instantiate your custom LocalizationManager deriving from the LocalizationManager object and set it to the static property LocalizationManager.Manager before the creation of the UI.

LocalizationManager.Manager = new CustomLocalizationManager();

Note that if you set the localization manager after the creation of the UI, some parts might remain not-localized.

What is left in order to fulfil the localization is to override the method GetStringOverride(). The logic is pretty simple, you just have to create a switch statement and return the correct translation for each resource key. Here is an example of how you can localize some of the strings in the two SpellCheckingDialogs:

Was this article helpful?

/

Give article feedback

Tell us how we can improve this article

Code samples are inaccurate / outdated.
I expected to find other / more information.
There are typos / broken links / broken page elements.
Content is inaccurate / outdated.
Other
By checking this box you consent to Progress contacting you by email about your response on this page.

Community

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.