从prevent异常消息被翻译成用户的语言? [英] Prevent exception messages from being translated into the user's language?

查看:165
本文介绍了从prevent异常消息被翻译成用户的语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让我的应用程序中显示的Win32 / .NET异常的消息时,请务必使用英语?

How do I make my application always use English when displaying win32/.net exceptions messages?

我得到这个消息时,它看起来像有人用Babelfish平台来翻译它(这是瑞典): System.ComponentModel.Win32Exception:Programmet孔德INTE启动市场eftersom programmets思达-VID-sidakonfiguration AR felaktig

I got this message, it looks like someone used babelfish to translate it (it's Swedish): "System.ComponentModel.Win32Exception: Programmet kunde inte starta eftersom programmets sida-vid-sidakonfiguration är felaktig."

非常无益的,和谷歌有高达4次,为这,他们没有帮助。 所以我猜测原始消息是和谷歌这一点。 (它是:该应用程序未能启动,因为其副作用并排配置不正确)

Extremely unhelpful, and Google had a whopping 4 hits for it, none of them helpful. So I have to guess what the original message was and google that. (It's was: "The application has failed to start because its side-by-side configuration is incorrect.")

这一次是相当简单的找出原始的错误消息是,从一开始就具有英语消息当然会救我的时间。

This time it was fairly simple to find out what the original error message was, having the message in English from the start would of course save me time.

那么,如何做到这一点?

So how do I do that?

推荐答案

您可以尝试设置 Thread.CurrentThread.CurrentUICulture 和/或 .CurrentCulture 的CultureInfo(EN-US)

You can try setting Thread.CurrentThread.CurrentUICulture and/or .CurrentCulture to CultureInfo("en-US").

这篇关于从prevent异常消息被翻译成用户的语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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