This is a migrated thread and some comments may be shown as answers.

Change telerik richeditor language to language set in windows machine

3 Answers 136 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
ajin prasad
Top achievements
Rank 1
ajin prasad asked on 22 Aug 2013, 02:32 PM
Hi All,

I am using telerik richtextbox control in my application. can I change the dictionary in telerik rich editor to language set in date/time set on windows.?
Can you provide any samples for this?

3 Answers, 1 is accepted

Sort by
0
Accepted
Anna
Telerik team
answered on 27 Aug 2013, 12:06 PM
Hi,

You can do this by adding a new RadDictionary to the DocumentSpellChecker collection of dictionaries. It will automatically switch between dictionaries depending on the current culture in which the RadRichTextBox is running. The following code should do the trick:

private void LoadDictionary( Stream tdfFileStream )
{
    RadDictionary dictionary = new RadDictionary();
    dictionary.Load( tdfFileStream );
    ( ( DocumentSpellChecker )this.radRichTextBox.SpellChecker ).AddDictionary( dictionary, new CultureInfo( "de-DE" );
}

You can add as many dictionaries as you'd like to support, just pass the desired cultures as a parameter of the AddDictionary method. You can find some dictionaries to use here.

I hope this answers your question. If you have any further difficulties, of course, do not hesitate to contact us.

Regards,
Anna
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
ajin prasad
Top achievements
Rank 1
answered on 23 Sep 2013, 04:59 PM
Hi,

For engilsh we have english(Australia), English(Malaysia), English(Great britain) etc etc.......
But currently our code supports English(US) only. so do we need to create seperate resource files to support English language in different regions?
0
Anna
Telerik team
answered on 25 Sep 2013, 12:42 PM
Hi Ajin Prasad,
If I understand you correctly, you would like to have one dictionary that will serve for all different regions. Unfortunately there isn't a way to set a dictionary to correspond to the general CultureInfo("en"), but what you can do is just list all the regions you would like to support. You will still have only one file, but it will be added multiple times. The end result will be something like this:

private void LoadDictionary(Stream tdfFileStream)
        {
            RadDictionary dictionary = new RadDictionary();
 
            dictionary.Load(tdfFileStream);
 
            DocumentSpellChecker spellchecker = this.radRichTextBox.SpellChecker as DocumentSpellChecker;
 
            spellchecker.AddDictionary(dictionary, new CultureInfo("en-CA"));
            spellchecker.AddDictionary(dictionary, new CultureInfo("en-AU"));
            spellchecker.AddDictionary(dictionary, new CultureInfo("en-GB"));
            //...
        }

Regards,
Anna
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
ajin prasad
Top achievements
Rank 1
Answers by
Anna
Telerik team
ajin prasad
Top achievements
Rank 1
Share this question
or