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

Use of tdf-file in DocumentSpellChecker

7 Answers 108 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Rieni De Rijke
Top achievements
Rank 1
Rieni De Rijke asked on 23 Mar 2011, 09:53 PM
I'm trying to change the spellchecker language.
I downloaded a nb-NO.tdf file and put it in the Resources.
I use your example..


InitializeComponent();
...
...
     ((DocumentSpellChecker)editor.SpellChecker).AddDictionary(new RadEn_USDictionary(), CultureInfo.InvariantCulture);
            LoadDictionary();
        }

        private void LoadDictionary()
        {
            var culture = new CultureInfo("nb-NO");
            var res = Properties.Resources.nb_NO;
            var tdfFileStream = new MemoryStream();
            tdfFileStream.Write(res, 0, res.Length);
            var dictionary = new RadDictionary();
            dictionary.Load(tdfFileStream);
            ((DocumentSpellChecker)editor.SpellChecker).AddDictionary(dictionary, culture);
            Thread.CurrentThread.CurrentCulture = culture; 
        }

But it does not work.
Do I call LoadDictionary() from the right place?
How should I tell the editor to use the new language?

7 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 25 Mar 2011, 03:22 PM
Hello Rieni De Rijke,

I have attached a demo project that shows you how to properly change the spell checking culture. If you change the thread culture, you have to manually invalidate the RadRichTextBox proofing. The recommended way to do this in Q1 2011 is to use the spell checker property as shown in the project.
Let us know if you have any further questions.

Greetings,
Ivailo
the Telerik team
0
Rieni De Rijke
Top achievements
Rank 1
answered on 27 Mar 2011, 09:44 PM
I'm afraid this doesn't work in WPF.
0
Ivailo Karamanolev
Telerik team
answered on 28 Mar 2011, 08:24 AM
Hi Rieni De Rijke,

It's my fault I didn't attach a WPF demo, however we have found the same code to be working just as correctly in WPF as in Silverlight. I am attaching the same solution, but with WPF demo added. If you continue to experience problems, feel free to get back to us with a specific issue or a demo project altogether.

Greetings,
Ivailo
the Telerik team
0
Avi Avni
Top achievements
Rank 1
answered on 14 Apr 2011, 02:24 PM
hi

i tried the wpf sample on hebrew but the red underline is not visible on
the hebrew word

thanks
0
Accepted
Iva Toteva
Telerik team
answered on 15 Apr 2011, 10:48 AM
Hi Ehud Pinchas,

Currently RadRichTextBox does not support writing in complex languages that include bidirectional text or ligatures. Hebrew requires both, so unfortunately you will not be able to edit or spell check Hebrew at this point.

Kind regards,
Iva
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Kotte
Top achievements
Rank 1
answered on 12 Oct 2011, 02:59 AM
Hi Ivailo,

I added a custom .tdf file "it-IT.tdf"(got from telerik forums) to SilverlightApplication1.
I am getting error when I am try to load to RadDictionary.

 Stream stream = Application.GetResourceStream(new Uri("/SilverlightApplication1;component/it-IT.tdf", UriKind.RelativeOrAbsolute)).Stream;
            RadDictionary dictionary = new RadDictionary();
            dictionary1.Load(stream);
            ((DocumentSpellChecker)this.editor.SpellChecker).AddDictionary(dictionary, CultureInfo.InvariantCulture);


I am not getting any error while loading "/SilverlightApplication1;component/en-US.tdf". in  SilverlightApplication1 application.
I am getting error When try to load the same "en-US.tdf" in to my local Silverlight application.

any suggestions??

Thanks,
Kotte.

 



0
Kotte
Top achievements
Rank 1
answered on 12 Oct 2011, 04:04 AM
its working now...

I changed the Build Action property to Resource and Copy to Output directory property to Copy if New.




Thanks,
Kotte
Tags
RichTextBox
Asked by
Rieni De Rijke
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Rieni De Rijke
Top achievements
Rank 1
Avi Avni
Top achievements
Rank 1
Iva Toteva
Telerik team
Kotte
Top achievements
Rank 1
Share this question
or