How to use enable pseudo-locale in Windows for testing?

狂风中的少年 提交于 2019-11-27 06:38:33

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

You can also change Internet Explorer's Accept-Languages to request qps-ploc language:

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.

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:

| 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      | --$$123,,4567,,8901..00  | -$123,,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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!