summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-18 17:55:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-18 17:55:24 +0300
commitc28759e7c9e63b1d092904b4299afdffec91bcdf (patch)
tree2707a12eddda373f779c1369015e5fac9148902c /src/mir_core
parent422b84ef2a9ccb27f456e2818a778a8b21b99b3d (diff)
new functions to access mirandaboot.ini from all plugins:
Profile_GetSetting() - reads a string from mirandaboot.ini Profile_GetSettingInt() - reads an integer from mirandaboot.ini
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/langpack.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp
index bb4ff63b9d..22c19a8552 100644
--- a/src/mir_core/src/langpack.cpp
+++ b/src/mir_core/src/langpack.cpp
@@ -637,9 +637,8 @@ void GetDefaultLang()
PathToAbsoluteW(L".", g_tszRoot);
// look into mirandaboot.ini
- wchar_t tszPath[MAX_PATH], tszLangName[256];
- PathToAbsoluteW(L"\\mirandaboot.ini", tszPath);
- GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath);
+ wchar_t tszLangName[256];
+ Profile_GetSetting(L"Language/DefaultLanguage", tszLangName);
if (tszLangName[0]) {
if (!mir_wstrcmpi(tszLangName, L"default")) {
db_set_ws(NULL, "Langpack", "Current", L"default");
@@ -652,6 +651,7 @@ void GetDefaultLang()
}
// try to load langpack that matches UserDefaultUILanguage
+ wchar_t tszPath[MAX_PATH];
if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) {
mir_snwprintf(tszPath, L"langpack_%s.txt", wcslwr(tszLangName));
if (!LoadLangPack(tszPath)) {