如何在Windows中使用enable伪语言环境进行测试? [英] How to use enable pseudo-locale in Windows for testing?

查看:181
本文介绍了如何在Windows中使用enable伪语言环境进行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows Vista引入了三个伪语言环境的概念>:

Pseudo Locale        Locale Name  LCID           
===================  ===========  ======
Base                 qps-ploc     0x0501
Mirrored             qps-mirr     0x09ff
East Asian-language  qps-asia     0x05fe

启用基本语言环境非常有用,因为您可以检查应用程序是否使用当前语言环境来格式化日期,时间,数字,货币等项目.

例如,当当前语言环境设置为基本时,日期的格式将为:

[Шěđлеśđαỳ!!!],2006年8月8日.

Windows的构建实际上是用伪造的,然后本地化为英语:

使用这些语言环境的另一个价值:它测试您的应用程序是否不假定16位 PRIMARYLANGID 由以下内容组成:

  • 8位主要语言ID
  • 8位子语言ID

实际上是PRIMARYLANGID是:

  • 10位主要语言ID
  • 6位子语言ID

或以图形方式:

+-----------------------+-------------------------+
|     Sublanguage ID    |   Primary Language ID   |
+-----------------------+-------------------------+
 15                   10 9                       0   bit

这三个伪语言环境终于在第8位的末尾走了(Microsoft一直在为破坏有缺陷的应用程序而烦恼).

如何在Windows中启用伪语言环境?

另请参见

解决方案

如何在Windows中启用伪语言环境?

最初这四个伪-locale的在控制面板中不可见:(

您可以通过添加一些注册表项来启用它们:

[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)

可以在RegEdit中完成

然后,您可以转到控制面板中的区域和语言选项:

,然后选择伪语言环境:

三种不同的伪语言环境用于测试3种语言环境:

基本 qps-ploc语言环境用于类似英语的伪本地化.它的字符串是英语字符串的较长版本,使用的是非拉丁字母和带重音符号的字符,而不是普通的脚本.另外,简单的拉丁字符串应在此语言环境下以相反的顺序排序.

镜像 qpa-mirr用于从右到左的伪数据,这是另一个值得关注的测试领域.

东亚 qps-asia旨在利用大型CJK字符库,这对于测试也很有用.


警告::请不要尝试更改系统区域设置" :

更改为新的伪语言环境:

否则,重新启动后:

Windows无法启动:

,唯一的解决方法是在网站上手动编辑注册表故障恢复控制台;恢复旧的en-US语言环境.


警告

使用伪语言环境来查找软件中的本地化错误.不幸的是,这也使您可以找到 其他人的 软件中的错误;包括微软的:

Windows Vista introduced the concept of three pseudo-locales:

Pseudo Locale        Locale Name  LCID           
===================  ===========  ======
Base                 qps-ploc     0x0501
Mirrored             qps-mirr     0x09ff
East Asian-language  qps-asia     0x05fe

Enabling the Base locale 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:

[Шěđлеśđαỳ !!!], 8 ōf [Μäŕςћ !!] ōf 2006

Builds of Windows are actually done in pseudo, and then localized into english:

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:

  • 8-bit primary language id
  • 8-bit sublanguage id

when in reality a PRIMARYLANGID is:

  • a 10-bit primary language id
  • a 6-bit sublanguage 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).

How do i enable pseudo-locale's in Windows?

See also

解决方案

How do i enable pseudo-locale's in Windows?

Initially the four pseudo-locale's are not visible in the Control Panel: (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.

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:

Then you can go to Regional and Language Options in the Control Panel:

and select the pseudo-locale:

The three different pseudo-locale are for testing 3 kinds of locales:

Base The 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.

Mirrored qpa-mirr is used for right-to-left pseudo data, which is another area of interest for testing.

East Asian qps-asia is intended to utilize the large CJK character repertoire, which is also useful for testing.


Warning: Do not try to change the "System Locale":

to a new pseudo-locale:

Otherwise after the reboot:

Windows will fail to start:

And the only fix will be to manually edit the registry from the Recovery Console; restoring the old en-US locale.


Warning

Use of pseudo-locales is used to find localization bugs in software. Unfortunately this will also let you find bugs in other people's software; including Microsoft's:

  • SQL Server Management Studio1 crashes when presented with other locales (Microsoft Connect):


  • Microsoft Excel will no longer let you enter functions (the comma used 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:

Good luck with getting Microsoft to dogfood their own product.

110.50.1617.0


Update 4//10/2012:

Trying to Edit top 200 rows of a table in SQL Server Management Studio:

Executed SQL statement SELECT TOP (200) ...
Error Source: Microsoft.SqlServer.Management.DataTools
Error Message: Object reference not set to an instance of an object

Is fixed by changing Negative sign symbol from -- to -.

Bonus Reading

这篇关于如何在Windows中使用enable伪语言环境进行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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