summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-06 21:53:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-06 21:53:58 +0000
commit554346643f6b22f4d0c2420034a39d61b62feaa3 (patch)
tree6834be81dd05b2854a6bdf23212572e47a66157a /src/mir_core
parent78bfee6c598fe618fe3de0d03925f11f95d6cdf9 (diff)
attempt to fix #721
git-svn-id: http://svn.miranda-ng.org/main/trunk@9717 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/langpack.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index 6b15feca74..43f0a42119 100644
--- a/src/mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -641,14 +641,17 @@ MIR_CORE_DLL(int) LoadLangPackModule(void)
hevChanged = CreateHookableEvent(ME_LANGPACK_CHANGED);
// look into mirandaboot.ini
- TCHAR tszDefaultLang[100], tszPath[MAX_PATH];
+ TCHAR tszDefaultLang[100], tszPath[MAX_PATH], tszRoot[MAX_PATH];
PathToAbsoluteT(_T("\\mirandaboot.ini"), tszPath);
if (GetPrivateProfileString(_T("Language"), _T("DefaultLanguage"), _T(""), tszDefaultLang, SIZEOF(tszDefaultLang), tszPath))
if (!LoadLangPack(tszDefaultLang))
return 0;
// finally try to load first file
- PathToAbsoluteT(_T("\\Languages\\langpack_*.txt"), tszPath);
+ PathToAbsoluteT(_T("\\Languages"), tszRoot);
+ if (_taccess(tszRoot, 0) != 0) // directory Languages exists
+ PathToAbsoluteT(_T("."), tszRoot);
+ mir_sntprintf(tszPath, SIZEOF(tszPath), _T("%s\\langpack_*.txt"), tszRoot);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(tszPath, &fd);
@@ -658,8 +661,9 @@ MIR_CORE_DLL(int) LoadLangPackModule(void)
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
continue;
- if (!LoadLangPack(fd.cFileName)) {
- db_set_ws(NULL, "Langpack", "Current", fd.cFileName);
+ mir_sntprintf(tszPath, SIZEOF(tszPath), _T("%s\\%s"), tszRoot, fd.cFileName);
+ if (!LoadLangPack(tszPath)) {
+ db_set_ts(NULL, "Langpack", "Current", fd.cFileName);
break;
}
}