Change telerik richeditor language to language set in windows machine

4 posts, 1 answers
  1. ajin prasad
    ajin prasad avatar
    19 posts
    Member since:
    May 2010

    Posted 22 Aug 2013 Link to this post

    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?
  2. Answer
    Anna
    Admin
    Anna avatar
    99 posts

    Posted 27 Aug 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. ajin prasad
    ajin prasad avatar
    19 posts
    Member since:
    May 2010

    Posted 23 Sep 2013 Link to this post

    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?
  5. Anna
    Admin
    Anna avatar
    99 posts

    Posted 25 Sep 2013 Link to this post

    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 >>
Back to Top