Problem with changing lanuage

Welcome, 

I'm trying to change my SpellChecker language. Here is my code: 

  Public Class MdnStringBox
        Inherits TextBox
        ' Implements IGetDefault

        Private mvarSpellEditor As MdnTextSpellEditor
        Public mvarEditor As IEditorProperties
        Public mvarSpellChecker As SfSpellChecker

        Private Shared mvarKeysToMiss As New List(Of Key) _
        (New Key() {Key.LeftAlt, Key.RightAlt, Key.LeftCtrl, Key.RightCtrl, Key.LeftShift, Key.RightShift, Key.LWin, Key.RWin})

        Public Sub New()
            MinHeight = 23
            TextAlignment = Windows.TextAlignment.Justify
            Padding = New Thickness(2)
            'SpellCheck.IsEnabled = True
            'SpellCheck.SpellingReform = SpellingReform.Postreform
            mvarSpellChecker = New SfSpellChecker()
            mvarSpellChecker.Dictionaries = New DictionaryCollection()
            Dim lvarIspellDictionary As IspellDictionary = New IspellDictionary()
            lvarIspellDictionary.Culture = New CultureInfo(Thread.CurrentThread.CurrentCulture.Name)
            lvarIspellDictionary.GrammarUri = New Uri("/WpfCom;component//Dictonaries/pl-PL.aff", UriKind.Relative)
            lvarIspellDictionary.DictionaryUri = New Uri("/WpfCom;component//Dictonaries/pl-PL.dic", UriKind.Relative)
            mvarSpellChecker.Dictionaries.Add(lvarIspellDictionary)
            mvarSpellChecker.Culture = New CultureInfo("pl-PL")
            mvarSpellEditor = New MdnTextSpellEditor(Me)
            mvarEditor = mvarSpellEditor
            mvarSpellChecker.PerformSpellCheckUsingContextMenu(mvarEditor)
        End Sub

        Private Sub SpellCheckerDialog() Handles Me.MouseDoubleClick
            mvarSpellChecker.PerformSpellCheckUsingDialog(mvarEditor)
        End Sub
End Class


But when i'm trying to use it i've got an error: Element with this key was already added.

What I'm doing wrong?

1 Reply 1 reply marked as answer

EM Elakkiya Muthukumarasamy Syncfusion Team November 23, 2020 01:21 PM UTC

Hi Stemplewski, 
 
Greetings from Syncfusion. 
 
We have checked your reported query “Problem with changing the language in SpellCheckerAdv” but we are unable to reproduce the reported error ”Element with this key was already added”. We have checked this issue in 18.3.0.50 version and prepared a simple sample to achieve your requirement. Please refer the sample link below. 
 
You can download the language file from the following link 
 
Please refer the documentation link: 
 
 
Please try it and if you have concerns with the provided solution please share us the issue reproducing sample and version details it will be helpful for us to provide a prompt solution this. 
 
Regards, 
Elakkiya 


Marked as answer
Loader.
Up arrow icon