在 Windows 上查找当前活动语言

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/685580/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:12:47  来源:igfitidea点击:

Finding the current active language on windows

windowsvb.netpowershell

提问by user41767

What are the possible solutions for finding the current active language which appears on the Windows language bar ?

查找出现在 Windows 语言栏上的当前活动语言的可能解决方案是什么?

采纳答案by RossFabricant

CultureInfo.CurrentCulture. This has information on the language and culture. If you just want the language name, try CultureInfo.CurrentCulture.ThreeLetterISOLanguageName.

CultureInfo.CurrentCulture. 这有关于语言和文化的信息。如果您只想要语言名称,请尝试CultureInfo.CurrentCulture.ThreeLetterISOLanguageName.

回答by Jeff Yates

You should look at the Multilingual APIs in Win32as a starting point. It's not entirely obvious from the documentation which call will provide you what you want, but I think the answer may lie with the calls relating to processes and threads, or preferred languages. You may need to do some experimentation to see which calls give the expected result of matching the language bar selection.

您应该将Win32中的多语言 API作为起点。从文档中哪个调用将为您提供您想要的内容并不完全显而易见,但我认为答案可能在于与进程和线程或首选语言相关的调用。您可能需要进行一些实验,以查看哪些调用会给出匹配语言栏选择的预期结果。

I suspect that the best call to try would be GetThreadUILanguage.

我怀疑最好的尝试是GetThreadUILanguage