在不使用代码的情况下更改 Windows 区域设置/文化

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4390744/
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 15:45:46  来源:igfitidea点击:

Change Windows Locale / Culture without using code

windowslocaleculture

提问by Anders Holmberg

This ought to be simple and it probably is but I can't seem to find an answer to this question...

这应该很简单,可能很简单,但我似乎无法找到这个问题的答案......

I am developing C# application using Visual Studio 2008 and the application supports a number of different languages. To test different languages on the development machine is simple (e.g. temporarily adding Thread.CurrentThread.CurrentUICulture = new CultureInfo("sv")to the application will let me test the Swedish translation) but how can I change the Locale / Culture on a test machine without using code? I want to use the following steps for my tests :

我正在使用 Visual Studio 2008 开发 C# 应用程序,该应用程序支持多种不同的语言。在开发机器上测试不同的语言很简单(例如,临时添加Thread.CurrentThread.CurrentUICulture = new CultureInfo("sv")到应用程序将让我测试瑞典语翻译)但是如何在不使用代码的情况下在测试机器上更改区域设置/文化?我想对我的测试使用以下步骤:

  1. Install Windows on test machine (English version).
  2. Install application on test machine.
  3. Run tests using English.
  4. Change Locale / Culture on test machine to Swedish.
  5. Repeat tests using Swedish.
  6. Repeat for every language the market division might think of;)
  1. 在测试机上安装Windows(英文版)。
  2. 在测试机上安装应用程序。
  3. 使用英语运行测试。
  4. 将测试机器上的语言环境/文化更改为瑞典语。
  5. 使用瑞典语重复测试。
  6. 对市场部门可能想到的每种语言重复一遍;)

回答by Martin v. L?wis

From the start menu, run intl.cpl. .NET initialized from GetUserDefaultUILanguage, which returns something different than the installation language only if you have MUI packs installed, see Microsoft's overview article.

从开始菜单,运行 intl.cpl。.NET 从GetUserDefaultUILanguage初始化,仅当您安装了 MUI 包时,它返回的内容与安装语言不同,请参阅 Microsoft 的概述文章