Index: src/libictranslate/LanguageDialog.cpp =================================================================== diff -u -r2b1551c7b24c42a5952096ead62e4de6c39983a3 -r8379c88620bc401673c4171e729f4d15a4d5354a --- src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 2b1551c7b24c42a5952096ead62e4de6c39983a3) +++ src/libictranslate/LanguageDialog.cpp (.../LanguageDialog.cpp) (revision 8379c88620bc401673c4171e729f4d15a4d5354a) @@ -430,7 +430,7 @@ // wOldLang [in] - specifies the old language code // wNewLang [in] - specifies the new language code. /////////////////////////////////////////////////////////////// -void CLanguageDialog::UpdateLanguage(WORD /*wOldLang*/, WORD /*wNewLang*/) +void CLanguageDialog::UpdateLanguage() { // cannot update for string based template if (m_uiResID == 0) @@ -461,7 +461,7 @@ lf.lfHeight = -MulDiv(m_prm->m_ld.GetPointSize(), GetDeviceCaps(hdc, LOGPIXELSY), 72); ::ReleaseDC(NULL, hdc); lf.lfWeight = FW_NORMAL; - lf.lfCharSet = m_prm->m_ld.GetCharset(); + lf.lfCharSet = DEFAULT_CHARSET; _tcscpy(lf.lfFaceName, m_prm->m_ld.GetFontFace()); delete m_pFont; @@ -559,7 +559,7 @@ { CDialog::OnInitDialog(); - UpdateLanguage(0,0); // because initially all the texts are empty + UpdateLanguage(); // because initially all the texts are empty EnableToolTips(TRUE); @@ -620,10 +620,10 @@ case WM_RMNOTIFY: if ((UINT)wParam == RMNT_LANGCHANGE) { - UpdateLanguage(HIWORD(lParam), LOWORD(lParam)); + UpdateLanguage(); // now update user controls (everybody has to do it him(her)self) - OnLanguageChanged(HIWORD(lParam), LOWORD(lParam)); + OnLanguageChanged(); break; } case WM_NOTIFY: Index: src/libictranslate/LanguageDialog.h =================================================================== diff -u -rd0d46e0ace97519c52eefcd66e1cab5b586dcac1 -r8379c88620bc401673c4171e729f4d15a4d5354a --- src/libictranslate/LanguageDialog.h (.../LanguageDialog.h) (revision d0d46e0ace97519c52eefcd66e1cab5b586dcac1) +++ src/libictranslate/LanguageDialog.h (.../LanguageDialog.h) (revision 8379c88620bc401673c4171e729f4d15a4d5354a) @@ -175,9 +175,9 @@ void OnHelpButton(); protected: - void UpdateLanguage(WORD wOldLang, WORD wNewLang); + void UpdateLanguage(); virtual UINT GetLanguageUpdateOptions() { return 0; }; - virtual void OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) { }; + virtual void OnLanguageChanged() { }; void Cleanup(); virtual BOOL OnTooltipText(UINT /*uiID*/, TOOLTIPTEXT* /*pTip*/) { return FALSE; }; Index: src/libictranslate/ResourceManager.cpp =================================================================== diff -u -rd99ea57e5e78d9b2cc7d6024d9f26f2b4da7cc86 -r8379c88620bc401673c4171e729f4d15a4d5354a --- src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision d99ea57e5e78d9b2cc7d6024d9f26f2b4da7cc86) +++ src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision 8379c88620bc401673c4171e729f4d15a4d5354a) @@ -153,14 +153,11 @@ CLangData::CLangData() : m_pszFilename(NULL), m_pszLngName(NULL), - m_pszBaseFile(NULL), m_pszFontFace(NULL), - m_wLangCode(0), m_wPointSize(0), m_pszHelpName(NULL), m_pszAuthor(NULL), m_pszVersion(NULL), - m_byCharset(0), m_bRTL(false), m_uiSectionID(0), m_bUpdating(false) @@ -171,7 +168,6 @@ { delete [] m_pszFilename; delete [] m_pszLngName; - delete [] m_pszBaseFile; delete [] m_pszFontFace; delete [] m_pszHelpName; delete [] m_pszAuthor; @@ -184,8 +180,6 @@ m_pszFilename = NULL; delete [] m_pszLngName; m_pszLngName = NULL; - delete [] m_pszBaseFile; - m_pszBaseFile = NULL; delete [] m_pszFontFace; m_pszFontFace = NULL; delete [] m_pszHelpName; @@ -201,17 +195,14 @@ CLangData::CLangData(const CLangData& ld) : m_pszFilename(NULL), m_pszLngName(NULL), - m_pszBaseFile(NULL), m_pszFontFace(NULL), m_pszHelpName(NULL), m_pszAuthor(NULL), m_pszVersion(NULL) { SetFilename(ld.GetFilename(true)); SetLangName(ld.GetLangName()); - SetLangCode(ld.GetLangCode()); SetFontFace(ld.GetFontFace()); - SetCharset(ld.GetCharset()); SetPointSize(ld.GetPointSize()); SetDirection(ld.GetDirection()); SetHelpName(ld.GetHelpName()); @@ -225,9 +216,7 @@ { SetFilename(rSrc.GetFilename(true)); SetLangName(rSrc.GetLangName()); - SetLangCode(rSrc.GetLangCode()); SetFontFace(rSrc.GetFontFace()); - SetCharset(rSrc.GetCharset()); SetPointSize(rSrc.GetPointSize()); SetDirection(rSrc.GetDirection()); SetHelpName(rSrc.GetHelpName()); @@ -244,10 +233,7 @@ { icpf::config cfg(icpf::config::eIni); const uint_t uiLangName = cfg.register_string(_T("Info/Lang Name"), _t("")); - const uint_t uiLangCode = cfg.register_signed_num(_T("Info/Lang Code"), 0, 0, 0xffff); - const uint_t uiBaseLanguage = cfg.register_string(_T("Info/Base Language"), _T("")); const uint_t uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); - const uint_t uiCharset = cfg.register_signed_num(_T("Info/Charset"), 0, 0, 0xffff); const uint_t uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); const uint_t uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); const uint_t uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); @@ -260,27 +246,14 @@ return false; SetLangName(psz); - ll_t ll = cfg.get_signed_num(uiLangCode); - if(ll == 0) - return false; - SetLangCode((WORD)ll); - - psz = cfg.get_string(uiBaseLanguage); - SetBaseFile(psz); - psz = cfg.get_string(uiFontFace); if(!psz || psz[0] == _t('\0')) return false; SetFontFace(psz); - ll = cfg.get_signed_num(uiCharset); + ll_t ll = cfg.get_signed_num(uiSize); if(ll == 0) return false; - SetCharset((BYTE)ll); - - ll = cfg.get_signed_num(uiSize); - if(ll == 0) - return false; SetPointSize((WORD)ll); SetDirection(cfg.get_bool(uiRTL)); @@ -427,10 +400,7 @@ // load data from file icpf::config cfg(icpf::config::eIni); const uint_t uiLangName = cfg.register_string(_T("Info/Lang Name"), _t("")); - const uint_t uiLangCode = cfg.register_signed_num(_T("Info/Lang Code"), 0, 0, 0xffff); - const uint_t uiBaseLanguage = cfg.register_string(_T("Info/Base Language"), _T("")); const uint_t uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); - const uint_t uiCharset = cfg.register_signed_num(_T("Info/Charset"), 0, 0, 0xffff); const uint_t uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); const uint_t uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); const uint_t uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); @@ -443,27 +413,14 @@ return false; SetLangName(psz); - ll_t ll = cfg.get_signed_num(uiLangCode); - if(ll == 0) - return false; - SetLangCode((WORD)ll); - - psz = cfg.get_string(uiBaseLanguage); - SetBaseFile(psz); - psz = cfg.get_string(uiFontFace); if(!psz || psz[0] == _t('\0')) return false; SetFontFace(psz); - ll = cfg.get_signed_num(uiCharset); + ll_t ll = cfg.get_signed_num(uiSize); if(ll == 0) return false; - SetCharset((BYTE)ll); - - ll = cfg.get_signed_num(uiSize); - if(ll == 0) - return false; SetPointSize((WORD)ll); SetDirection(cfg.get_bool(uiRTL)); @@ -510,10 +467,7 @@ // load data from file icpf::config cfg(icpf::config::eIni); cfg.set_string(_t("Info/Lang Name"), m_pszLngName); - cfg.set_string(_T("Info/Lang Code"), _itot(m_wLangCode, szTemp, 10)); - cfg.set_string(_T("Info/Base Language"), _T("")); cfg.set_string(_T("Info/Font Face"), m_pszFontFace); - cfg.set_string(_T("Info/Charset"), _itot(m_byCharset, szTemp, 10)); cfg.set_string(_T("Info/Size"), _itot(m_wPointSize, szTemp, 10)); cfg.set_string(_T("Info/RTL reading order"), m_bRTL ? _T("1") : _T("0")); cfg.set_string(_T("Info/Help name"), m_pszHelpName); @@ -644,11 +598,6 @@ _tcscpy(m_pszLngName, psz); } -void CLangData::SetBaseFile(PCTSTR psz) -{ - SetFnameData(&m_pszBaseFile, psz); -} - void CLangData::SetFontFace(PCTSTR psz) { if (m_pszFontFace) @@ -745,10 +694,7 @@ bool CResourceManager::SetLanguage(PCTSTR pszPath) { - WORD wOldLang = 0; bool bRet = false; - WORD wNewLang = 0; - tchar_t szPath[_MAX_PATH]; // parse the path to allow reading the english language first @@ -776,11 +722,9 @@ EnterCriticalSection(&m_cs); try { - wOldLang=m_ld.GetLangCode(); bRet = m_ld.ReadTranslation(szPath); // base language if(bRet && pszPath) bRet=m_ld.ReadTranslation(pszPath, true); // real language - wNewLang=m_ld.GetLangCode(); } catch(...) { @@ -796,13 +740,13 @@ while (it != m_lhDialogs.end()) { if (::IsWindow((*it)->m_hWnd)) - (*it)->PostMessage(WM_RMNOTIFY, RMNT_LANGCHANGE, (LPARAM)(wOldLang << 16 | wNewLang)); + (*it)->PostMessage(WM_RMNOTIFY, RMNT_LANGCHANGE, 0); it++; } // send the notification stuff to the others if (m_pfnCallback) - (*m_pfnCallback)(RMNT_LANGCHANGE, (wOldLang << 16 | wNewLang)); + (*m_pfnCallback)(RMNT_LANGCHANGE); return bRet; } Index: src/libictranslate/ResourceManager.h =================================================================== diff -u -rd99ea57e5e78d9b2cc7d6024d9f26f2b4da7cc86 -r8379c88620bc401673c4171e729f4d15a4d5354a --- src/libictranslate/ResourceManager.h (.../ResourceManager.h) (revision d99ea57e5e78d9b2cc7d6024d9f26f2b4da7cc86) +++ src/libictranslate/ResourceManager.h (.../ResourceManager.h) (revision 8379c88620bc401673c4171e729f4d15a4d5354a) @@ -37,7 +37,7 @@ // RMNT_LANGCHANGE, LPARAM - HIWORD - old language, LOWORD - new language #define RMNT_LANGCHANGE 0x0001 -typedef void(*PFNNOTIFYCALLBACK)(uint_t, uint_t); +typedef void(*PFNNOTIFYCALLBACK)(uint_t); /////////////////////////////////////////////////////////// // language description structure @@ -100,18 +100,9 @@ void SetLangName(PCTSTR psz); PCTSTR GetLangName() const { return m_pszLngName; }; - void SetBaseFile(PCTSTR psz); - PCTSTR GetBaseFile() const { return m_pszBaseFile; }; - - void SetLangCode(WORD wLang) { m_wLangCode=wLang; }; - WORD GetLangCode() const { return m_wLangCode; }; - void SetFontFace(PCTSTR psz); PCTSTR GetFontFace() const { return m_pszFontFace; }; - void SetCharset(BYTE byChar) { m_byCharset=byChar; }; - BYTE GetCharset() const { return m_byCharset; }; - void SetPointSize(WORD wSize) { m_wPointSize=wSize; }; WORD GetPointSize() const { return m_wPointSize; }; @@ -136,14 +127,11 @@ protected: TCHAR *m_pszFilename; // file name of the language data (with path) TCHAR *m_pszLngName; // name of the language (ie. Chinese (PRC)) - TCHAR *m_pszBaseFile; // file with base language data (wo path) TCHAR *m_pszFontFace; // face name of the font that will be used in dialogs - WORD m_wLangCode; // language code WORD m_wPointSize; // font point size TCHAR *m_pszHelpName; // help name (wo the directory) for this language TCHAR *m_pszAuthor; // author name TCHAR *m_pszVersion; // version of this file - BYTE m_byCharset; // charset for use with the font bool m_bRTL; // does the language require right-to-left reading order ? // strings (for controls in dialog boxes the ID contains hi:dlg ID, lo:ctrl ID, for strings hi part is 0)