diff options
-rw-r--r-- | include/m_langpack.h | 6 | ||||
-rw-r--r-- | libs/win32/mir_core.lib | bin | 493774 -> 493794 bytes | |||
-rw-r--r-- | libs/win64/mir_core.lib | bin | 499046 -> 499060 bytes | |||
-rw-r--r-- | protocols/Telegram/src/auth.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/Windows/langpack.cpp | 11 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 |
7 files changed, 20 insertions, 1 deletions
diff --git a/include/m_langpack.h b/include/m_langpack.h index 10ad9bd182..b70deb9c2c 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -88,6 +88,12 @@ EXTERN_C MIR_CORE_DLL(int) Langpack_GetDefaultCodePage(void); EXTERN_C MIR_CORE_DLL(int) Langpack_GetDefaultLocale(void);
/////////////////////////////////////////////////////////////////////////////////////////
+// returns 2-byte locale name associated with the language pack
+// if locale is not set, returns "en"
+
+MIR_CORE_DLL(char *) Langpack_GetDefaultLocaleName();
+
+/////////////////////////////////////////////////////////////////////////////////////////
// reloads langpack
// wParam = 0 (ignored)
// lParam = (LPARAM)(wchar_t*)langpack file name or NULL to reload the current one
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex 6dfe8bcc5b..f8e046d131 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex ca4d9a5a0f..16cfc1e6f1 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib diff --git a/protocols/Telegram/src/auth.cpp b/protocols/Telegram/src/auth.cpp index 53aa8d5c82..a00ff42b7c 100644 --- a/protocols/Telegram/src/auth.cpp +++ b/protocols/Telegram/src/auth.cpp @@ -113,7 +113,7 @@ void CTelegramProto::ProcessAuth(TD::updateAuthorizationState *pObj) request->use_secret_chats_ = true;
request->api_id_ = MIRANDA_API_ID;
request->api_hash_ = MIRANDA_API_HASH;
- request->system_language_code_ = "en";
+ request->system_language_code_ = Langpack_GetDefaultLocaleName();
request->device_model_ = T2Utf(m_wszDeviceName).get();
request->application_version_ = text;
request->enable_storage_optimizer_ = true;
diff --git a/src/mir_core/src/Windows/langpack.cpp b/src/mir_core/src/Windows/langpack.cpp index 963174d161..40b72d3a43 100644 --- a/src/mir_core/src/Windows/langpack.cpp +++ b/src/mir_core/src/Windows/langpack.cpp @@ -516,6 +516,17 @@ MIR_CORE_DLL(int) Langpack_GetDefaultLocale() return (langPack.Locale == 0) ? LOCALE_USER_DEFAULT : langPack.Locale;
}
+MIR_CORE_DLL(char*) Langpack_GetDefaultLocaleName()
+{
+ static char buf[10];
+ if (langPack.Locale == 0)
+ strcpy(buf, "en");
+ else
+ GetLocaleInfoA(langPack.Locale, LOCALE_SPARENT, buf, _countof(buf));
+
+ return buf;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
MIR_CORE_DLL(char*) TranslateA_LP(const char *str, HPLUGIN pPlugin)
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index c26da39e57..1b934ef47f 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1559,3 +1559,4 @@ db_event_updateId @1772 ?isExecutable@MFilePath@@QBE_NXZ @1783 NONAME
?GetPlugin@CDlgBase@@QBEPBVCMPluginBase@@XZ @1784 NONAME
_TranslateW_UUID@8 @1785 NONAME
+?Langpack_GetDefaultLocaleName@@YGPADXZ @1786 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 267d2af5c9..8007570bba 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1559,3 +1559,4 @@ db_event_updateId @1772 ?isExecutable@MFilePath@@QEBA_NXZ @1783 NONAME
?GetPlugin@CDlgBase@@QEBAPEBVCMPluginBase@@XZ @1784 NONAME
TranslateW_UUID @1785 NONAME
+?Langpack_GetDefaultLocaleName@@YAPEADXZ @1786 NONAME
|