Problems to specify another language for the spelling.

5 posts, 0 answers
  1. Raymundo
    Raymundo avatar
    3 posts
    Member since:
    May 2015

    Posted 08 Dec 2015 Link to this post

    How I can change language? The platform is Windows Form with c #
  2. Dimitar
    Admin
    Dimitar avatar
    1408 posts

    Posted 09 Dec 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Raymundo
    Raymundo avatar
    3 posts
    Member since:
    May 2015

    Posted 14 Dec 2015 in reply to Dimitar Link to this post

    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();
            }

  5. Dimitar
    Admin
    Dimitar avatar
    1408 posts

    Posted 15 Dec 2015 Link to this post

    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
  6. Raymundo
    Raymundo avatar
    3 posts
    Member since:
    May 2015

    Posted 11 Jan in reply to Raymundo Link to this post

    Thank you very much, I was solved.!!
Back to Top
UI for WinForms is Visual Studio 2017 Ready