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

Problems to specify another language for the spelling.

4 Answers 51 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Raymundo
Top achievements
Rank 1
Raymundo asked on 08 Dec 2015, 06:33 PM
How I can change language? The platform is Windows Form with c #

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 09 Dec 2015, 06:47 AM
Hi Raymundo,

Thank you for writing.

You should change the dictionary, the following article shows how this can be achieved: Spellcheck.

The following page contains some dictionaries: http://www.telerik.com/support/code-library/dictionaries-for-radspellchecker

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Raymundo
Top achievements
Rank 1
answered on 14 Dec 2015, 11:29 PM

Thanks for your reply. And try to do it switch to Spanish, however continued in the default dictionary language. They can help, I have the following programming code:

 

private static readonly CultureInfo SpanishCulture = CultureInfo.GetCultureInfo("es-ES");
 
private void Initialize()
        {
            InitializeComponent();
 
            RadSpellCheckerLocalizationProvider.CurrentProvider = new MySpanishSpellCheckerLocalizationProvider();
            IControlSpellChecker textBoxControlSpellChecker = this.radSpellChecker1.GetControlSpellChecker(typeof(RichTextBox));
            DocumentSpellChecker documentSpellChecker = textBoxControlSpellChecker.SpellChecker as DocumentSpellChecker;
            documentSpellChecker.AddDictionary(new SpanishDictionary(), SpanishCulture);
            documentSpellChecker.SpellCheckingCulture = SpanishCulture;
        }
         
private void radBtnEnableSpellCheck_Click(object sender, System.EventArgs e)
        {
            RadSpellCheckerLocalizationProvider.CurrentProvider = new MySpanishSpellCheckerLocalizationProvider();
            IControlSpellChecker textBoxControlSpellChecker = this.radSpellChecker1.GetControlSpellChecker(typeof(RichTextBox));
            DocumentSpellChecker documentSpellChecker = textBoxControlSpellChecker.SpellChecker as DocumentSpellChecker;
            documentSpellChecker.AddDictionary(new SpanishDictionary(), SpanishCulture);
            documentSpellChecker.SpellCheckingCulture = SpanishCulture;
             
            bool enabled = this.radRichTextBox1.IsSpellCheckingEnabled;
            this.radRichTextBox1.IsSpellCheckingEnabled = !enabled;
            this.radRichTextBox1.Focus();
        }

0
Dimitar
Telerik team
answered on 15 Dec 2015, 02:11 PM
Hello Raymundo,

Thank you for writing back.

It appears that you are using a separate spellchecker which is not necessary for this case. The following snippet shows how you can change the dictionary:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    private static readonly CultureInfo SpanishCulture = CultureInfo.GetCultureInfo("es-ES");
    RadRichTextBox radRichTextBox1 = new RadRichTextBox();
 
    public RadForm1()
    {
        InitializeComponent();
        radRichTextBox1.Parent = this;
        radRichTextBox1.IsSpellCheckingEnabled = true;
    }
 
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
                     
        DocumentSpellChecker documentSpellChecker = this.radRichTextBox1.SpellChecker as DocumentSpellChecker;
        documentSpellChecker.AddDictionary(GetDictioanry(), SpanishCulture);
        documentSpellChecker.SpellCheckingCulture = SpanishCulture;
    }
 
    private WordDictionary GetDictioanry()
    {
        WordDictionary dictionary = new WordDictionary();
        
        using (FileStream fs = File.OpenRead(@"..\..\es-ES.tdf"))
        {
            dictionary.Load(fs);
        }
        return dictionary;
    }
}

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Raymundo
Top achievements
Rank 1
answered on 11 Jan 2016, 09:13 PM
Thank you very much, I was solved.!!
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Raymundo
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Raymundo
Top achievements
Rank 1
Share this question
or