|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Rado Manzela
|
Apr 15, 2014 - 1:40 PM
|
I want to localize my application, but I have no idea how, do you have some tutorial on this? I’ve checked your LanguageSwitcher sample application, but there is lot of code calling undocumented functions like RscInst_RemoveAll() and it does not even work. When I switch the language, menus are changed, but main dialog is always in English. Would it be simpler if I don’t need language switch on the fly? How can I set the language when application starts? Thank you.
|
|
Rado Manzela
|
Apr 17, 2014 - 2:19 PM
|
Thank you, actually I was trying this approach before, but it didn’t work for context menus, then I’ve found it was cmdManager which overwrote my strings from other non-localized menu which is using the same command IDs :) Now it seems to be working, I’ll just have to rewrite all LoadString() etc.
|
|
Art Wilkes
|
Apr 15, 2014 - 2:16 PM
|
here is what I use for doing the actual switching. This code is in the initial instance of the main app code.
VERIFY( g_CmdManager->ProfileSetup(m_ProfUISControlsProfileName ) );
CWinApp * pApp = ::AfxGetApp();
g_ResourceManager->AllowCustomLang();
g_ResourceManager->AllowCustomLang(); // these are for reference int nEnglishvalue = (INT)__EXT_MFC_LANG_ID_ENGLISH_US; // 1033 int nGermanvalue = (INT)__EXT_MFC_LANG_ID_GERMAN; // 1031 int nFrenchvalue = (INT)__EXT_MFC_LANG_ID_FRENCH; // 1036 int nDutchvalue = (INT)__EXT_MFC_LANG_ID_DUTCH_NETHERLANDS; // 1043
m_nCurrentLangDefine = GetProfileInt( _T("LocalizationSettings"), _T("LanguageID"), (INT)__EXT_MFC_LANG_ID_ENGLISH_US ); // these are left for testing //WORD nDesiredLangID =(WORD) GetProfileInt( _T("LocalizationSettings"), _T("LanguageID"), (INT)__EXT_MFC_LANG_ID_ENGLISH_US ); //WORD nDesiredLangID =(WORD) GetProfileInt( _T("LocalizationSettings"), _T("LanguageID"), (INT)__EXT_MFC_LANG_ID_GERMAN ); //WORD nDesiredLangID =(WORD) GetProfileInt( _T("LocalizationSettings"), _T("LanguageID"), (INT)__EXT_MFC_LANG_ID_FRENCH ); //WORD nDesiredLangID =(WORD) GetProfileInt( _T("LocalizationSettings"), _T("LanguageID"), (INT)__EXT_MFC_LANG_ID_DUTCH_NETHERLANDS );
g_ResourceManager->SetLangIdDesired( m_nCurrentLangDefine );
This assumes you have set the language in the registry and have the .RC file and .h file configured correctly. We are fairly knowledge about this and we are developing a product line that is described on the website www.cpptext.com to help with program localization. I would be interested in hearing more about your localization project. Prof-UIS Support
|
|