如何在英国英语中进行拼写检查,即使在非英国机器上也是如此? [英] How do I get spell checking in UK English, even on a non-UK machine?

查看:65
本文介绍了如何在英国英语中进行拼写检查,即使在非英国机器上也是如此?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现WPF
内置支持拼写检查
。这非常好,但(逻辑上)默认为机器上的文化集。我的客户位于英国,希望全球所​​有用户都使用英国英语。这意味着无论用户的机器文化如何,我都需要确保拼写检查器使用英国
英语。


所以,我想这个问题有三个部分......


1)如何告诉WPF使用英国英语而不是机器默认?


2)如何包含英国英语词典应用程序,因为我不会想到非英国机器默认会有英国字典。


3)我如何在整个应用程序中执行此操作?我希望这是默认设置,我不想在每个文本框上启用拼写检查,也不想在每个窗口或用户控件中设置文化。


任何人都可以提供建议?谢谢

解决方案

你好Y先生 ossu,


>>任何人都可以提供建议吗?谢谢


请检查以下主题,并使用以下代码为整个应用程序设置一次默认语言:


 //将默认语言设为英语。 。 。 
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo(" en-GB");

FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement),
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name)));

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8e6ee26a-2b83-49c0-be8b-3398a5a85f71/how-to-change-wpf-textbox -spell-check-language?forum = wpf


祝你好运,



I just discovered that WPF has built-in support for spell checking. This is excellent, but (logically) defaults to the culture set on the machine. My client is based in the UK, and wants all users worldwide to use UK English. This means I need to ensure that the spell checker uses UK English, irrespective of the user's machine culture.

So, I guess there are three parts to this question...

1) How do I tell WPF to use UK English instead of the machine default?

2) How do I include a UK English dictionary with the application, as I wouldn't have thought that a non-UK machine would have a UK dictionary by default.

3) How do I do this across the application? I want this to be the default, I don't want to have to enable spell checking on every textbox, nor to set the culture in every window or user control.

Anyone able to advise? Thanks

解决方案

Hi Mr Yossu,

>>Anyone able to advise? Thanks

Please check the following thread, which set the default language once for the whole application by using the following code:

// Set default language to UK English . . .
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("en-GB");

FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), 
                new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name)));

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8e6ee26a-2b83-49c0-be8b-3398a5a85f71/how-to-change-wpf-textbox-spell-check-language?forum=wpf

Best regards,

Zhanglong


这篇关于如何在英国英语中进行拼写检查,即使在非英国机器上也是如此?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆