winapivisual-c++wtl

CreatePropertySheetPage localization prioritizes Neutral language


I have an old WTL project, basically a property sheet form with a few property pages. I want to add localization to it. Microsoft really-really wants me to use separate resource-only DLL for localization. I would like to see if I can do it with all language specific resources in the same executable.

When I add a property page I call CPropertySheetImpl<T>::AddPage, which internally calls CreatePropertySheetPage with a parameter of type PROPSHEETPAGE. I thought I can set the language with SetThreadLocale or SetThreadUILanguage but neither of those works if there is a dialog with Neutral language in the resource (.rc) file. The system overrides the thread settings and picks neutral language dialog over my chosen language. If there are two specific languages (for instance English and German) then the system selects the one that is set in thread settings.

Is this a known "feature" of Windows, or am I doing something wrong? Maybe I shouldn't have resources with neutral language. Maybe there is a better alternative to SetThreadLocale.


Solution

  • In the end I removed Neutral language resurces.