From 7465e1dc8f03725af5e8f7d16f92f8179acb7abf Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 25 Jul 2013 23:22:13 +0000 Subject: [PATCH] [BUG_FIXED] Fix Language Switcher not working bug while localization command option is used. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1085 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Parameters.cpp | 19 +++++++------------ .../WinControls/Preference/preferenceDlg.cpp | 2 -- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index e3d5c48a..1425b87b 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -748,12 +748,7 @@ bool NppParameters::reloadStylers(TCHAR *stylePath) bool NppParameters::reloadLang() { // use user path -#ifdef UNICODE generic_string nativeLangPath(_localizationSwitcher._nativeLangPath); -#else - generic_string nativeLangPath(_userPath); - PathAppend(nativeLangPath, generic_string(TEXT("nativeLang.xml"))); -#endif // if "nativeLang.xml" does not exist, use npp path if (!PathFileExists(nativeLangPath.c_str())) @@ -989,21 +984,21 @@ bool NppParameters::load() //----------------------------------------------// generic_string nativeLangPath; - + nativeLangPath = _userPath; + PathAppend(nativeLangPath, TEXT("nativeLang.xml")); + + // LocalizationSwitcher should use always user path + _localizationSwitcher._nativeLangPath = nativeLangPath; + if (_startWithLocFileName != TEXT("")) // localization argument detected, use user wished localization { + // overwrite nativeLangPath variable nativeLangPath = _nppPath; PathAppend(nativeLangPath, TEXT("localization\\")); PathAppend(nativeLangPath, _startWithLocFileName); } else // use %appdata% location, or (if absence then) npp installed location { - nativeLangPath = _userPath; - PathAppend(nativeLangPath, TEXT("nativeLang.xml")); - - // LocalizationSwitcher should use always user path - _localizationSwitcher._nativeLangPath = nativeLangPath; - if (!PathFileExists(nativeLangPath.c_str())) { nativeLangPath = _nppPath; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 10e30040..c5635462 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -478,7 +478,6 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) { case IDC_COMBO_LOCALIZATION : { -#ifdef UNICODE LocalizationSwitcher & localizationSwitcher = pNppParam->getLocalizationSwitcher(); int index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_GETCURSEL, 0, 0); wchar_t langName[MAX_PATH]; @@ -498,7 +497,6 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ::InvalidateRect(_hParent, NULL, TRUE); } } -#endif } return TRUE; default: