Using Pseudo-Locales for Localization Testing

On Windows Vista and later, you can use pseudo-locales for testing the localization of applications. This topic includes procedures for using pseudo-codes.

Enable a Pseudo-Locale

You can enable a pseudo-locale using registry key settings. As described in LCTYPE Constants (National Language Support), the settings are made under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls subkey for the languages installed on the operating system. You can make the following settings to enable the supported pseudo-locales:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Locale]
"00000501"="1"
"000009ff"="d"
"000005fe"="7"

Enumerate Pseudo-Locales

Note that NLS does not automatically enumerate the pseudo-locales or expose them in the regional and language options in the Control Panel. They are only enumerable if values are set in the registry. Your application can then call EnumSystemLocalesEx to enumerate the locales that the registry recognizes. The values for the locales are all of string (REG_SZ) type.

Retrieve Locale Information

The application uses GetLocaleInfoEx to retrieve information about a pseudo-locale. In the call, the application passes the locale name of the particular pseudo-locale, for example, "qps-mirr" for the mirrored pseudo-locale.

Use LocaleNameToLCID with Pseudo-Locales

You can use the NLS mapping function LocaleNameToLCID for pseudo-locales. This function operates even if the locales are not enabled, because it does not have to check the registry key for a locale.

Using National Language Support, Pseudo-Locales, EnumSystemLocalesEx, GetLocaleInfoEx, LocaleNameToLCID