如何在Windows中使用enable pseudo-locale进行测试?

时间:2011-08-12 16:01:00

标签: windows windows-7 localization internationalization pseudolocalization

Windows Vista引入了三个pseudo-locales的概念:

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

启用 Base 区域设置非常有用,因为您可以检查应用程序是否使用当前区域设置来格式化项目,例如日期,时间,数字,金钱。

例如,当前区域设置设置为 Base 时,日期格式为:

  

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

构建Windows are actually done in pseudo,然后本地化为英语:

enter image description here

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

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

in reality a PRIMARYLANGID is时:

  • 10位主要语言ID
  • 一个6位子语言id

或图形化:

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

这三个伪语言环境终于走到了第8位的末尾(微软一直厌倦了打破错误的应用程序)。

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

另见

4 个答案:

答案 0 :(得分:22)

  

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

最初the four pseudo-locale's are not visible in the Control Panelarchive.org

  

请注意,NLS不会自动枚举伪语言环境,也不会在“控制面板”的区域和语言选项部分中公开它们。如果在注册表中设置了值,它们只是可枚举的。

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

[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中完成:

enter image description here

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

enter image description here

并选择伪语言环境:

enter image description here

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

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

镜像 qpa-mirr用于从右到左的伪数据,这是测试的另一个感兴趣的领域。

东亚 qps-asia旨在利用大型CJK角色曲目,这对测试也很有用。


警告尝试更改“系统区域设置”

enter image description here

到一个新的伪语言环境:

enter image description here

否则重启后:

enter image description here

Windows将无法启动:

enter image description here

唯一的解决办法是manually edit the registry from the Recovery Console;恢复旧的en-US区域设置。


警告

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

  • SQL Server Management Studio 1 在与其他区域设置(Microsoft Connect)一起显示时崩溃:

    enter image description here
    enter image description here enter image description here

  • Microsoft Excel将不再允许您输入功能(用于分隔参数的逗号不再有效)

  • Visual Studio将不再允许您编辑逗号分隔的属性

  • SQL Server Management Studio图表设计器报告错误

  • .NET在日期和时间格式中存在错误,显示22////11////2011 4::::42::::53 P̰̃M]

  • Windows事件查看器:

    enter image description here

  • 任务计划程序:

    enter image description here

  • SQL Server Management Studio:

    enter image description here

祝好运微软为他们自己的产品做好准备。

1 10.50.1617.0


更新4 // 10/2012:

尝试在SQL Server Management Studio中编辑前200行表:

enter image description here

  

执行SQL语句SELECT TOP(200)...
  错误源:Microsoft.SqlServer.Management.DataTools
  错误消息:对象引用未设置为对象的实例

通过将 -- 中的负号符号更改为 - 来解决。

奖金阅读

答案 1 :(得分:5)

您还可以将Internet Explorer的Accept-Languages更改为请求qps-ploc语言:

enter image description here

您可以使用它来测试您的网站是否支持psuedo-locale,并检查任何缺少的本地化:

enter image description here

您可以在此示例网站中看到我错过了两位文字。

答案 2 :(得分:2)

看起来不是修复.NET,SQL Server,Excel等中的本地化错误,Microsoft改变了Windows 10中的Pseudo语言环境来掩盖错误:

>>> from pandas import DataFrame
>>> example = DataFrame({"text": "the quick brown fox jumps over the lazy dog", "families": [["famA", "famB", "famE"]]})
>>> example
             families                                         text
0  [famA, famB, famE]  the quick brown fox jumps over the lazy dog

[1 rows x 2 columns]

我可以理解不想修复你的错误,因为你很懒,这太难了。但你应该被迫为所有人看到你的耻辱。

相反,你可以试图隐藏你的失败。那太糟糕了。

答案 3 :(得分:0)

Windows 10 1803

不幸的是,从Windows 10 1803开始,似乎不再可能启用这些语言环境:

对于Windows 10版本1803,像这样编辑Windows注册表无效。但是,您仍然可以使用伪语言环境的名称调用非枚举NLS API(请参见上面的代码示例)来填充用户界面(UI)。

根据https://social.technet.microsoft.com/Forums/office/en-US/88de942e-7967-4419-b1fb-23d200c75fe3/unable-to-use-psuedo-locales-after-1803-win-10-update?forum=win10itprogeneral

请注意,它们仍是Windows内置的,仍然可以正常工作,只是它们没有出现在枚举中-因此它们没有出现在下拉列表中-因此使它们更加棘手使用。我正在寻找解决方法。

基本上,如果使用适当的伪语言环境从计算机复制Computer \ HKEY_CURRENT_USER \ Control Panel \ International(不是子项)中的注册表值,则即使未枚举,也应将其用于进一步的处理。

用于手动配置的注册表值

这是从1607系统导出的值。可以将它们放入.reg文件中以方便导入。

如果使用.reg文件,则需要以下标头:

Windows Registry Editor Version 5.00

伪(Pseudo)[qps-ploc]

[HKEY_CURRENT_USER\Control Panel\International]
"Locale"="00000501"
"LocaleName"="qps-ploc"
"s1159"="АΜ"
"s2359"="P̰̃M]"
"sCountry"="Pseudo"
"sCurrency"="$"
"sDate"="/"
"sDecimal"="."
"sGrouping"="4;0"
"sLanguage"="ENU"
"sList"=",,"
"sLongDate"="dddd, d 'ōf' MMMM 'ōf' yyyy"
"sMonDecimalSep"="."
"sMonGrouping"="4;0"
"sMonThousandSep"=",,"
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"="++"
"sShortDate"="d/MM/yy"
"sThousand"=",,"
"sTime"=":"
"sTimeFormat"="H:mm:ss"
"sShortTime"="h:mm tt"
"sYearMonth"="MMMM yyyy"
"iCalendarType"="1"
"iCountry"="61"
"iCurrDigits"="3"
"iCurrency"="0"
"iDate"="1"
"iDigits"="3"
"NumShape"="1"
"iFirstDayOfWeek"="0"
"iFirstWeekOfYear"="0"
"iLZero"="1"
"iMeasure"="1"
"iNegCurr"="1"
"iNegNumber"="1"
"iPaperSize"="1"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="0"

伪(伪亚洲)[qps-ploca]

[HKEY_CURRENT_USER\Control Panel\International]
"Locale"="000005FE"
"LocaleName"="qps-ploca"
"s1159"="午前"
"s2359"="午後"
"sCountry"="Pseudo Asia"
"sCurrency"="¥"
"sDate"="/"
"sDecimal"="."
"sGrouping"="3;0"
"sLanguage"="JPN"
"sList"=","
"sLongDate"="yyyy'年'M'月'd'日'"
"sMonDecimalSep"="."
"sMonGrouping"="3;0"
"sMonThousandSep"=","
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"=""
"sShortDate"="yyyy/MM/dd"
"sThousand"=","
"sTime"=":"
"sTimeFormat"="H:mm:ss"
"sShortTime"="H:mm"
"sYearMonth"="yyyy'年'M'月'"
"iCalendarType"="1"
"iCountry"="81"
"iCurrDigits"="0"
"iCurrency"="0"
"iDate"="2"
"iDigits"="2"
"NumShape"="1"
"iFirstDayOfWeek"="6"
"iFirstWeekOfYear"="0"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="1"
"iNegNumber"="1"
"iPaperSize"="9"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="0"

伪(伪镜像)[qps-plocm]

[HKEY_CURRENT_USER\Control Panel\International]
"Locale"="000009FF"
"LocaleName"="qps-plocm"
"s1159"="ص"
"s2359"="م"
"sCountry"="Pseudo Mirrored"
"sCurrency"="ر.س.‏"
"sDate"="/"
"sDecimal"="."
"sGrouping"="3;0"
"sLanguage"="ARA"
"sList"=";"
"sLongDate"="dd/MMMM/yyyy"
"sMonDecimalSep"="."
"sMonGrouping"="3;0"
"sMonThousandSep"=","
"sNativeDigits"="٠١٢٣٤٥٦٧٨٩"
"sNegativeSign"="-"
"sPositiveSign"=""
"sShortDate"="dd/MM/yy"
"sThousand"=","
"sTime"=":"
"sTimeFormat"="hh:mm:ss tt"
"sShortTime"="hh:mm tt"
"sYearMonth"="MMMM, yyyy"
"iCalendarType"="23"
"iCountry"="966"
"iCurrDigits"="2"
"iCurrency"="2"
"iDate"="1"
"iDigits"="2"
"NumShape"="0"
"iFirstDayOfWeek"="5"
"iFirstWeekOfYear"="0"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="3"
"iNegNumber"="3"
"iPaperSize"="9"
"iTime"="0"
"iTimePrefix"="0"
"iTLZero"="1"

伪(伪自托管)[qps-Latn-x-sh]

[HKEY_CURRENT_USER\Control Panel\International]
"Locale"="00000901"
"LocaleName"="qps-Latn-x-sh"
"s1159"="AM"
"s2359"="PM"
"sCountry"="Pseudo Selfhost"
"sCurrency"="J$"
"sDate"="/"
"sDecimal"="."
"sGrouping"="3;0"
"sLanguage"="ENJ"
"sList"=","
"sLongDate"="dd MMMM, yyyy"
"sMonDecimalSep"="."
"sMonGrouping"="3;0"
"sMonThousandSep"=","
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"=""
"sShortDate"="dd/MM/yyyy"
"sThousand"=","
"sTime"=":"
"sTimeFormat"="HH:mm:ss"
"sShortTime"="HH:mm"
"sYearMonth"="MMMM, yyyy"
"iCalendarType"="1"
"iCountry"="1"
"iCurrDigits"="2"
"iCurrency"="0"
"iDate"="1"
"iDigits"="2"
"NumShape"="1"
"iFirstDayOfWeek"="6"
"iFirstWeekOfYear"="0"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="1"
"iNegNumber"="1"
"iPaperSize"="1"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="1"