From 079353cd4c6f0905d210126eb5a0ccc6fe5af9b9 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 20 Nov 2010 21:13:47 +0000 Subject: [PATCH] [BUG_FIXED] Fix localization switching under Windows 7 problem (UAC issue). git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@711 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Parameters.cpp | 23 ++++-- PowerEditor/visual.net/notepadPlus.vcproj | 97 +++++++++++++++++++++++ 2 files changed, 113 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 82fc74bba..2c21160de 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -719,12 +719,18 @@ bool NppParameters::reloadStylers(TCHAR *stylePath) bool NppParameters::reloadLang() { - generic_string nativeLangPath(_nppPath); + // 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())) { - nativeLangPath = _userPath; + nativeLangPath = _nppPath; PathAppend(nativeLangPath, generic_string(TEXT("nativeLang.xml"))); if (!PathFileExists(nativeLangPath.c_str())) return false; @@ -833,7 +839,7 @@ bool NppParameters::load() if (doRecover) { - generic_string srcLangsPath(_userPath); + generic_string srcLangsPath(_nppPath); PathAppend(srcLangsPath, TEXT("langs.model.xml")); ::CopyFile(srcLangsPath.c_str(), langs_xml_path.c_str(), FALSE); } @@ -955,7 +961,12 @@ bool NppParameters::load() //----------------------------------------------// generic_string nativeLangPath(_userPath); PathAppend(nativeLangPath, TEXT("nativeLang.xml")); - + + // LocalizationSwitcher should use always user path +#ifdef UNICODE + _localizationSwitcher._nativeLangPath = nativeLangPath; +#endif + if (!PathFileExists(nativeLangPath.c_str())) { nativeLangPath = _nppPath; @@ -971,9 +982,7 @@ bool NppParameters::load() _pXmlNativeLangDocA = NULL; isAllLaoded = false; } -#ifdef UNICODE - _localizationSwitcher._nativeLangPath = nativeLangPath; -#endif + //---------------------------------// // toolbarIcons.xml : for per user // //---------------------------------// diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index 24eaff219..a20799083 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -390,6 +390,103 @@ CommandLine="copy ..\src\config.model.xml ..\installer\zipped.package.release\ansi\config.model.xml copy ..\src\langs.model.xml ..\installer\zipped.package.release\ansi\langs.model.xml copy ..\src\stylers.model.xml ..\installer\zipped.package.release\ansi\stylers.model.xml copy ..\src\shortcuts.xml ..\installer\zipped.package.release\ansi\shortcuts.xml copy ..\src\contextMenu.xml ..\installer\zipped.package.release\ansi\contextMenu.xml ..\misc\vistaIconTool\changeIcon.bat "..\misc\vistaIconTool\ReplaceVistaIcon.exe" "$(OutDir)\notepad++.exe" " /> + + + + + + + + + + + + + + + + + + + +