The localized resource library is global to a module. Each plug-in is not allowed to define its own localization library, although it is free to load and use any library as it sees fit. The module manager does not manage these libraries for the plug-in.
It is recommended that you use the LOCALE_DEF convenience macro when defining locale records for use with kmm_set_locale_info(). This will ensure that future changes in the API will only minimally affect your code. For example:
kmm_module_locale my_locales[] = { LOCALE_DEF(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), L"english.dll", KMM_MLOC_FLAG_DEFAULT), LOCALE_DEF(MAKELANGID(LANG_DUTCH,SUBLANG_DUTCH), L"dutch.dll", 0), LOCALE_DEF(MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_MODERN), L"spanish.dll", 0) }; int n_locales = sizeof(my_locales)/sizeof(my_locales[0]); ... kmm_set_locale_info(h_module, my_locales, n_locales); ...
See kmm_set_locale_info() and kmm_module_locale for more info.
If a match is found, that library is selected. Otherwise, the list is searched for one that is compatible with the current user locale. A locale record is compatible with the user locale if the primary language matches.
If a match is still not found, the first record in the locale array that has the KMM_MLOC_FLAG_DEFAULT flag set will be selected.
If a match is still not found, then the kmm_set_locale_info() will return KHM_ERROR_NOT_FOUND.
|
Generated on Fri Aug 3 08:27:13 2007 for Network Identity Manager by Doxygen 1.5.2 © 2004-2007 Massachusetts Institute of Technology. © 2005-2007 Secure Endpoints Inc. Contact khimaira@mit.edu |
|