如何在 Windows 中使用启用伪语言环境进行测试?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7042920/
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
How to use enable pseudo-locale in Windows for testing?
提问by Ian Boyd
Windows Vista introduced the concept of three pseudo-locales:
Windows Vista 引入了三个伪语言环境的概念:
Pseudo Locale Locale Name LCID
=================== =========== ======
Base qps-ploc 0x0501
Mirrored qps-mirr 0x09ff
East Asian-language qps-asia 0x05fe
Enabling the Baselocale is useful, because you can check that your application is using the current locale for formatting of items such as dates, times, numbers, money.
启用基本语言环境很有用,因为您可以检查应用程序是否使用当前语言环境来设置日期、时间、数字、金钱等项目的格式。
For example when the current locale is set to Base, a date will be formatted as:
例如,当当前语言环境设置为Base 时,日期将被格式化为:
[Шě?ле??α? !!!], 8 ōf [Μ???? !!] ōf 2006
[Шě?ле??α? !!!], 8 ōf [Μ???? !!] 2006 年
Builds of Windows are actually done in pseudo, and then localized into english:
Windows 的构建实际上是在 pseudo 中完成的,然后本地化为英语:
Another value in the use of these locale's: it tests that your application doesn't assume that a 16-bit PRIMARYLANGID
is made up of an:
使用这些语言环境的另一个价值:它测试您的应用程序是否假定 16 位PRIMARYLANGID
由以下内容组成:
- 8-bit primary language id
- 8-bit sublanguage id
- 8 位主要语言 ID
- 8 位子语言 ID
when in reality a PRIMARYLANGID is:
- a 10-bit primary language id
- a 6-bit sublanguage id
- 一个 10 位的主要语言 ID
- 一个 6 位的子语言 ID
or graphically:
或以图形方式:
+-----------------------+-------------------------+
| Sublanguage ID | Primary Language ID |
+-----------------------+-------------------------+
15 10 9 0 bit
These three pseudo-locale's finally walk off the end of the 8th bit (something that Microsoft has been weary of doing for breaking buggy applications).
这三个伪语言环境终于走出了第 8 位的结尾(微软为了破坏有缺陷的应用程序而厌倦了这样做)。
How do i enable pseudo-locale's in Windows?
如何在 Windows 中启用伪语言环境?
See also
也可以看看
回答by Ian Boyd
How do i enable pseudo-locale's in Windows?
如何在 Windows 中启用伪语言环境?
Initially the four pseudo-locale'sare not visible in the Control Panel: (archive.org)
最初,四个伪语言环境在控制面板中不可见:(archive.org)
Note that NLS does not automatically enumerate the pseudo-locales or expose them in the regional and language options portion of the Control Panel. They are only enumerable if values are set in the registry.
请注意,NLS 不会自动枚举伪语言环境或在控制面板的区域和语言选项部分中公开它们。只有在注册表中设置了值时,它们才可枚举。
You enable them by adding some registry keys:
您可以通过添加一些注册表项来启用它们:
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Locale]
"00000501"="1" // qps-ploc (Windows Vista and later)
"000005fe"="7" // qps-ploca (Windows Vista and later)
"00000901"="1" // qps-Latn-x-sh (Windows 10 and later)
"000009ff"="d" // qps-plocm (Windows Vista and later)
Which can be done in RegEdit:
这可以在 RegEdit 中完成:
Then you can go to Regional and Language Optionsin the Control Panel:
然后您可以转到控制面板中的区域和语言选项:
and select the pseudo-locale:
并选择伪语言环境:
The three different pseudo-locale are for testing 3 kinds of locales:
三种不同的伪语言环境用于测试 3 种语言环境:
BaseThe qps-ploc
locale is used for English-like pseudo localizations. Its strings are longer versions of English strings, using non-Latin and accented characters instead of the normal script. Additionally simple Latin strings should sort in reverse order with this locale.
基地的qps-ploc
区域用于英文般的伪本地化。它的字符串是英文字符串的更长版本,使用非拉丁文和重音字符代替普通脚本。此外,简单的拉丁字符串应与此语言环境以相反的顺序排序。
Mirroredqpa-mirr
is used for right-to-left pseudo data, which is another area of interest for testing.
Mirroredqpa-mirr
用于从右到左的伪数据,这是另一个需要测试的领域。
East Asianqps-asia
is intended to utilize the large CJK character reperttheitroade, which is also useful for testing.
East Asianqps-asia
旨在利用大型 CJK 字符库,这对测试也很有用。
Warning:Do nottry to change the "System Locale":
警告:不要不试图改变“系统区域设置”:
to a new pseudo-locale:
到一个新的伪语言环境:
Otherwise after the reboot:
否则重启后:
Windows will fail to start:
Windows 将无法启动:
And the only fix will be to manually edit the registry from the Recovery Console; restoring the old en-US
locale.
唯一的解决方法是从故障恢复控制台手动编辑注册表;恢复旧的en-US
语言环境。
Warning
警告
Use of pseudo-locales is used to find localization bugs in software. Unfortunately this will also let you find bugs in other people'ssoftware; including Microsoft's:
伪语言环境的使用用于查找软件中的本地化错误。不幸的是,这也会让您在其他人的软件中发现错误;包括微软的:
SQL Server Management Studio1crashes when presented with other locales (Microsoft Connect):
Microsoft Excel will no longer let you enter functions (the commaused to separate parameters no longer works)
Visual Studio will no longer let you edit comma separated properties
The SQL Server Management Studio diagram designer reports an error
.NET has a bug in the date and time formatting, showing
22////11////2011 4::::42::::53 P??M]
Windows Event Viewer:
Task Scheduler:
SQL Server Management Studio:
SQL Server Management Studio 1在与其他区域设置 ( Microsoft Connect)一起显示时崩溃:
Microsoft Excel 将不再让您输入函数(用于分隔参数的逗号不再有效)
Visual Studio 将不再允许您编辑逗号分隔的属性
SQL Server Management Studio 图设计器报错
.NET 的日期和时间格式存在错误,显示
22////11////2011 4::::42::::53 P??M]
Windows 事件查看器:
任务调度器:
SQL Server 管理工作室:
Good luck with getting Microsoft to dogfood their own product.
祝微软好运,让他们自己的产品狗粮。
110.50.1617.0
110.50.1617.0
Update 4//10/2012:
更新 4//10/2012:
Trying to Edit top 200 rowsof a table in SQL Server Management Studio:
尝试在 SQL Server Management Studio 中编辑表的前 200 行:
Executed SQL statement SELECT TOP (200) ...
Error Source: Microsoft.SqlServer.Management.DataTools
Error Message: Object reference not set to an instance of an object
已执行 SQL 语句 SELECT TOP (200) ...
错误来源:Microsoft.SqlServer.Management.DataTools
错误消息:未将对象引用设置为对象的实例
Is fixed by changing Negative sign symbolfrom --
to -
.
通过将负号符号从更改为--
来修复-
。
Bonus Reading
奖励阅读
回答by Ian Boyd
You can also change Internet Explorer's Accept-Languages
to request qps-ploc
language:
您还可以更改 Internet Explorer 的Accept-Languages
请求qps-ploc
语言:
You can use this to test that your web-site supports psuedo-locale, and check any missing localizations:
您可以使用它来测试您的网站是否支持伪语言环境,并检查任何缺少的本地化:
You can see i missed two bits of text in this sample web-site.
你可以看到我在这个示例网站中遗漏了两段文字。
回答by Ian Boyd
It looks like rather than fixing the localization bugs in .NET, SQL Server, Excel, etc, Microsoft changed the Pseudo locale in Windows 10 to mask the bugs:
看起来微软并没有修复 .NET、SQL Server、Excel 等中的本地化错误,而是更改了 Windows 10 中的伪语言环境以掩盖错误:
| Item | Windows 7 | Windows 10 |
|-----------------------|--------------------------|-----------------------|
| Locale Identifier | 0x0501 (1281) | 0x0501 (1281) |
| Locale Name | qps-ploc | qps-ploc |
| Example Number | --123,,4567,,8901 | -123,,4567,,8901 |
| Example Currency | --$3,,4567,,8901..00 | -3,,4567,,8901.000 |
| Example Float | --123,,4567,,8901..00 | -123,,4567,,8901.000 |
| Example Date | 9//08//2015 | 9/8/2015 |
| Example Time | 9::51::17 АΜ | 9:45:09 |
| Example DateTime | 9//08//2015 9::51::17 АΜ | 9/8/2015 9:45 |
| LOCALE_SLANGUAGE | Pseudo Language (Pseudo) | Pseudo (Pseudo) |
| LOCALE_SENGLANGUAGE | Pseudo Language | Pseudo |
| LOCALE_SDECIMAL | .. | . |
| LOCALE_SCURRENCY | $$ | $ |
| LOCALE_SMONDECIMALSEP | .. | . |
| LOCALE_SDATE | // | / |
| LOCALE_STIME | :: | : |
| LOCALE_SSHORTDATE | d//MM//yyyy | d/MM/yy |
| LOCALE_STIMEFORMAT | h::mm::ss tt | H:mm:ss |
| LOCALE_ITIME | 0 | 1 |
| LOCALE_ICENTURY | 1 | 0 |
| LOCALE_SNEGATIVESIGN | -- | - |
I can understand not wanting to fix your bugs, because you're lazy it's too hard. But you should have been forced to wear your shame for all to see.
我可以理解不想修复您的错误,因为您太懒了太难了。但是你应该被迫让所有人看到你的耻辱。
Instead you cop-out and try to hide your failure. That's just bad.
相反,你逃避并试图隐藏你的失败。那太糟糕了。