diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index e3d5c48a4..1425b87b6 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 10e300405..c5635462a 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: