DivExpress 拼写检查器支持多种语言
我需要检查英语和希腊语单词。我使用 SpellCheckerOpenOfficeDictionary 添加英语和希腊语词典。 它就不起作用
Public Sub SpellCheckSettings(ByRef objSpellChecker As SpellChecker)
Dim objDictionary, objGreekdic As SpellCheckerOpenOfficeDictionary
Dim objCulture, objGreekCulture As CultureInfo
Try
objCulture = New CultureInfo("en-US")
objSpellChecker.Culture = objCulture
objDictionary = New SpellCheckerOpenOfficeDictionary(GetLanguageDictionaryPath("en_US.dic"), GetLanguageDictionaryPath("en_US.aff"), objCulture)
objSpellChecker.Dictionaries.Add(objDictionary)
objGreekCulture = New CultureInfo("el")
objGreekdic = New SpellCheckerOpenOfficeDictionary(GetLanguageDictionaryPath("el_GR.dic"), GetLanguageDictionaryPath("el_GR.aff"), objGreekCulture)
objSpellChecker.Dictionaries.Add(objGreekdic)
Catch ex As Exception
End Try
End Sub
但如果我使用上述任何一种拼写检查都可以正常工作,那么 。请任何人帮忙
I need to check both english and Greek words. I used SpellCheckerOpenOfficeDictionary to add the English and greek dictionary. But it is not working
Public Sub SpellCheckSettings(ByRef objSpellChecker As SpellChecker)
Dim objDictionary, objGreekdic As SpellCheckerOpenOfficeDictionary
Dim objCulture, objGreekCulture As CultureInfo
Try
objCulture = New CultureInfo("en-US")
objSpellChecker.Culture = objCulture
objDictionary = New SpellCheckerOpenOfficeDictionary(GetLanguageDictionaryPath("en_US.dic"), GetLanguageDictionaryPath("en_US.aff"), objCulture)
objSpellChecker.Dictionaries.Add(objDictionary)
objGreekCulture = New CultureInfo("el")
objGreekdic = New SpellCheckerOpenOfficeDictionary(GetLanguageDictionaryPath("el_GR.dic"), GetLanguageDictionaryPath("el_GR.aff"), objGreekCulture)
objSpellChecker.Dictionaries.Add(objGreekdic)
Catch ex As Exception
End Try
End Sub
IF I use either of the above the spell check works perfectly. Any one please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将拼写检查器的区域性设置为不变值。在这种情况下,拼写检查器将使用两个词典来检查单词和计算建议。您可以使用以下代码设置拼写检查器的文化:
Set the SpellChecker's Culture to the Invariant value. In this case, the spellChecker will use both dictionaries to check words and calc suggestions. You can set the spellChecker's Culture using the following code: