diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-22 16:10:40 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-22 16:10:40 +0300 |
commit | 6ccfdcb25f2bb3c7a4e39a055bb392c0d4bfa905 (patch) | |
tree | b53333d819f9afe5fd44dd874cfc0f51189122f8 | |
parent | 295ca5e99da922699f1bae398f0411f0c99df5f6 (diff) |
m_langpack.h unbound from hLangpack
-rw-r--r-- | include/m_langpack.h | 22 | ||||
-rw-r--r-- | plugins/BasicHistory/src/stdafx.h | 9 | ||||
-rw-r--r-- | plugins/ClientChangeNotify/src/stdafx.h | 9 | ||||
-rw-r--r-- | plugins/ExternalAPI/m_variables.h | 2 | ||||
-rw-r--r-- | plugins/FavContacts/src/stdafx.h | 10 | ||||
-rw-r--r-- | plugins/ListeningTo/src/stdafx.h | 10 | ||||
-rw-r--r-- | plugins/MimCmd/src/MimCmd.cpp | 12 | ||||
-rw-r--r-- | plugins/MimCmd/src/commands.cpp | 8 | ||||
-rwxr-xr-x | plugins/New_GPG/src/stdafx.h | 10 | ||||
-rw-r--r-- | plugins/OpenSSL/src/ssl_openssl.cpp | 6 | ||||
-rw-r--r-- | plugins/TranslitSwitcher/src/Layoutproc.cpp | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.h | 5 | ||||
-rwxr-xr-x | protocols/JabberG/src/stdafx.h | 5 | ||||
-rw-r--r-- | src/mir_core/src/CCtrlPages.cpp | 4 | ||||
-rw-r--r-- | src/mir_core/src/CCtrlTreeView.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/bitmaps.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/langpack.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/miranda.cpp | 3 | ||||
-rw-r--r-- | src/mir_core/src/timezones.cpp | 2 | ||||
-rw-r--r-- | utils/mir_options.cpp | 12 | ||||
-rw-r--r-- | utils/mir_smileys.cpp | 2 |
21 files changed, 68 insertions, 71 deletions
diff --git a/include/m_langpack.h b/include/m_langpack.h index 1156849820..b097053515 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -45,14 +45,14 @@ EXTERN_C MIR_CORE_DLL(int) LoadLangPackModule(void); EXTERN_C MIR_CORE_DLL(int) LoadLangPack(const wchar_t *szLangPack);
EXTERN_C MIR_CORE_DLL(void) ReloadLangpack(wchar_t *pszStr);
-EXTERN_C MIR_CORE_DLL(char*) TranslateA_LP(const char *str, int hLang);
-EXTERN_C MIR_CORE_DLL(wchar_t*) TranslateW_LP(const wchar_t *str, int hLang);
-EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang);
+EXTERN_C MIR_CORE_DLL(char*) TranslateA_LP(const char *str, int hLang = 0);
+EXTERN_C MIR_CORE_DLL(wchar_t*) TranslateW_LP(const wchar_t *str, int hLang = 0);
+EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang = 0);
-#define Translate(s) TranslateA_LP(s, hLangpack)
-#define TranslateW(s) TranslateW_LP(s, hLangpack)
-#define TranslateT(s) TranslateW_LP(_A2W(s), hLangpack)
-#define TranslateDialogDefault(h) TranslateDialog_LP(h,hLangpack)
+#define Translate(s) TranslateA_LP(s, g_plugin.m_hLang)
+#define TranslateW(s) TranslateW_LP(s, g_plugin.m_hLang)
+#define TranslateT(s) TranslateW_LP(_A2W(s), g_plugin.m_hLang)
+#define TranslateDialogDefault(h) TranslateDialog_LP(h, g_plugin.m_hLang)
// If you're storing some string for calling later-on Translate or using it
// with an API call that does translation automatically marked with
@@ -68,9 +68,9 @@ EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang); // translates a menu into the user's local language
// returns 0 on success, nonzero on failure
-EXTERN_C MIR_CORE_DLL(void) TranslateMenu_LP(HMENU, int = hLangpack);
+EXTERN_C MIR_CORE_DLL(void) TranslateMenu_LP(HMENU, int langId);
-#define TranslateMenu(h) TranslateMenu_LP(h,hLangpack)
+#define TranslateMenu(h) TranslateMenu_LP(h, g_plugin.m_hLang)
/////////////////////////////////////////////////////////////////////////////////////////
// returns the codepage used in the language pack
@@ -92,8 +92,8 @@ EXTERN_C MIR_CORE_DLL(int) Langpack_GetDefaultLocale(void); EXTERN_C MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr);
/////////////////////////////////////////////////////////////////////////////////////////
-// retrieves the hLangpack of a plugin by its HINSTANCE
-// returns hLangpack if found, or 0 if error occurred
+// retrieves the language id of a plugin by its HINSTANCE
+// returns id if found, or 0 if error occurred
EXTERN_C MIR_APP_DLL(int) GetPluginLangByInstance(HINSTANCE);
diff --git a/plugins/BasicHistory/src/stdafx.h b/plugins/BasicHistory/src/stdafx.h index 881e94fc82..f2e353cb67 100644 --- a/plugins/BasicHistory/src/stdafx.h +++ b/plugins/BasicHistory/src/stdafx.h @@ -58,6 +58,11 @@ #include "m_smileyadd.h"
#include "m_metacontacts.h"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin();
+};
+
#include "../../libs/zlib/src/zconf.h"
#include "../../libs/zlib/src/ioapi.h"
#include "../../libs/zlib/src/zip.h"
@@ -92,7 +97,3 @@ HICON LoadIconEx(int iconId, bool big = false); #define MODULENAME "BasicHistory"
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin();
-};
\ No newline at end of file diff --git a/plugins/ClientChangeNotify/src/stdafx.h b/plugins/ClientChangeNotify/src/stdafx.h index 497ee6ac1d..f02330f144 100644 --- a/plugins/ClientChangeNotify/src/stdafx.h +++ b/plugins/ClientChangeNotify/src/stdafx.h @@ -52,6 +52,10 @@ #include "m_fingerprint.h"
+{
+ CMPlugin();
+};
+
#include "TMyArray.h"
#include "Options.h"
#include "CString.h"
@@ -84,11 +88,6 @@ #define MODULENAME "ClientChangeNotify"
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin();
-};
-
#define LOG_ID MODULENAME
#define LOG_PREFIX MODULENAME ": " // for netlib.log
diff --git a/plugins/ExternalAPI/m_variables.h b/plugins/ExternalAPI/m_variables.h index 6277c84a2e..0e015f7ce6 100644 --- a/plugins/ExternalAPI/m_variables.h +++ b/plugins/ExternalAPI/m_variables.h @@ -534,7 +534,7 @@ __inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) { szTipInfo = (char *)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPTIPTEXT);
if (szTipInfo == nullptr)
- szTipInfo = Translate("Open String Formatting Help");
+ szTipInfo = TranslateA_LP("Open String Formatting Help", 0);
SendMessage(GetDlgItem(hwndDlg, uIDButton), BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0);
SendDlgItemMessage(hwndDlg, uIDButton, BUTTONSETASFLATBTN, 0, 0);
diff --git a/plugins/FavContacts/src/stdafx.h b/plugins/FavContacts/src/stdafx.h index 2ab32caea4..858d735c8f 100644 --- a/plugins/FavContacts/src/stdafx.h +++ b/plugins/FavContacts/src/stdafx.h @@ -49,6 +49,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_metacontacts.h>
#include <m_toptoolbar.h>
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin();
+};
+
#include "resource.h"
#include "version.h"
#include "contact_cache.h"
@@ -100,8 +105,3 @@ void InitServices(); void UninitServices();
extern IconItem iconList[];
-
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin();
-};
diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h index 8727d8dda8..52ab19b677 100644 --- a/plugins/ListeningTo/src/stdafx.h +++ b/plugins/ListeningTo/src/stdafx.h @@ -47,6 +47,11 @@ Boston, MA 02111-1307, USA. #include <m_toptoolbar.h>
#include <m_listeningto.h>
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin();
+};
+
#include "../../utils/mir_options.h"
#include "../../utils/mir_buffer.h"
#include "../../utils/utf8_helpers.h"
@@ -71,11 +76,6 @@ Boston, MA 02111-1307, USA. #define MODULENAME "ListeningTo"
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin();
-};
-
// Global Variables
extern BOOL loaded;
diff --git a/plugins/MimCmd/src/MimCmd.cpp b/plugins/MimCmd/src/MimCmd.cpp index 39a3dcbe39..b5d6bf3f72 100644 --- a/plugins/MimCmd/src/MimCmd.cpp +++ b/plugins/MimCmd/src/MimCmd.cpp @@ -43,17 +43,17 @@ void PrintUsage() wchar_t name[128];
GetProgramName(name, _countof(name));
- wprintf(TranslateT("%s usage:\n"), name);
- wprintf(TranslateT("%s <command> [<param> [<param> [...]]].\n"), name);
- wprintf(TranslateT("This will tell Miranda to run the specified command. The commands can have zero, one or more parameters. Use '%s help' to get a list of possible commands.\n"), name);
- wprintf(TranslateT("No command can have more than %d parameters.\n"), MAX_ARGUMENTS - 1);
+ wprintf(TranslateW_LP(L"%s usage:\n"), name);
+ wprintf(TranslateW_LP(L"%s <command> [<param> [<param> [...]]].\n"), name);
+ wprintf(TranslateW_LP(L"This will tell Miranda to run the specified command. The commands can have zero, one or more parameters. Use '%s help' to get a list of possible commands.\n"), name);
+ wprintf(TranslateW_LP(L"No command can have more than %d parameters.\n"), MAX_ARGUMENTS - 1);
}
void ShowVersion()
{
wchar_t name[128];
GetProgramName(name, _countof(name));
- wprintf(TranslateT("%s version %s"), name, __VERSION_STRING_DOTS);
+ wprintf(TranslateW_LP(L"%s version %s"), name, __VERSION_STRING_DOTS);
}
int wmain(int argc, wchar_t *argv[])
@@ -104,7 +104,7 @@ int wmain(int argc, wchar_t *argv[]) wprintf(L"%s\n", reply->message);
}
else {
- wprintf(TranslateT("Unknown command '%s'.\n"), argv[1]);
+ wprintf(TranslateW_LP(L"Unknown command '%s'.\n"), argv[1]);
error = 0;
}
diff --git a/plugins/MimCmd/src/commands.cpp b/plugins/MimCmd/src/commands.cpp index 37a6be7795..10a437e383 100644 --- a/plugins/MimCmd/src/commands.cpp +++ b/plugins/MimCmd/src/commands.cpp @@ -114,16 +114,16 @@ void HandleHelpCommand(PCommand, wchar_t *argv[], int argc, PReply reply) if (command) {
reply->code = MIMRES_SUCCESS;
- szReply.Append(TranslateW(command->help));
+ szReply.Append(TranslateW_LP(command->help));
}
else {
reply->code = MIMRES_NOTFOUND;
- szReply.AppendFormat(TranslateT("No help for '%s'."), argv[2]);
+ szReply.AppendFormat(TranslateW_LP(L"No help for '%s'."), argv[2]);
}
}
else {
reply->code = MIMRES_SUCCESS;
- szReply.Append(TranslateT("Available commands: "));
+ szReply.Append(TranslateW_LP(L"Available commands: "));
for (int i = 0; i < cKnownCommands - 1; i++) {
szReply.Append(knownCommands[i].command);
@@ -179,7 +179,7 @@ void ProcessConsoleCommand(PCommand command, wchar_t *arguments[], int count, PR case WAIT_OBJECT_0 + 1: //close event
default:
- mir_wstrcpy(sdCmdLine->reply.message, TranslateT("Miranda has been closed or an error has occurred while waiting for the result, could not process request."));
+ mir_wstrcpy(sdCmdLine->reply.message, TranslateW_LP(L"Miranda has been closed or an error has occurred while waiting for the result, could not process request."));
done = TRUE;
break;
diff --git a/plugins/New_GPG/src/stdafx.h b/plugins/New_GPG/src/stdafx.h index 77b649545a..699f69bbc1 100755 --- a/plugins/New_GPG/src/stdafx.h +++ b/plugins/New_GPG/src/stdafx.h @@ -73,6 +73,11 @@ using std::fstream; #include <m_metacontacts.h> +struct CMPlugin : public PLUGIN<CMPlugin> +{ + CMPlugin(); +}; + //internal #include "resource.h" #include "version.h" @@ -87,9 +92,4 @@ using std::fstream; #include "options.h" #include "globals.h" -struct CMPlugin : public PLUGIN<CMPlugin> -{ - CMPlugin(); -}; - #endif diff --git a/plugins/OpenSSL/src/ssl_openssl.cpp b/plugins/OpenSSL/src/ssl_openssl.cpp index 2d477e8dde..20056c5495 100644 --- a/plugins/OpenSSL/src/ssl_openssl.cpp +++ b/plugins/OpenSSL/src/ssl_openssl.cpp @@ -101,12 +101,12 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false) return; case SEC_E_INVALID_TOKEN: - tszMsg += TranslateT("Client cannot decode host message. Possible causes: host does not support SSL or requires not existing security package"); + tszMsg += TranslateW_LP(L"Client cannot decode host message. Possible causes: host does not support SSL or requires not existing security package"); break; case CERT_E_CN_NO_MATCH: case SEC_E_WRONG_PRINCIPAL: - tszMsg += TranslateT("Host we are connecting to is not the one certificate was issued for"); + tszMsg += TranslateW_LP(L"Host we are connecting to is not the one certificate was issued for"); break; default: @@ -404,7 +404,7 @@ static INT_PTR GetSslApi(WPARAM, LPARAM lParam) int LoadSslModule(void) { if (!SSL_library_load()) { - MessageBoxW(nullptr, TranslateT("OpenSSL library loading failed"), TranslateT("OpenSSL error"), MB_ICONERROR | MB_OK); + MessageBoxW(nullptr, TranslateW_LP(L"OpenSSL library loading failed"), TranslateW_LP(L"OpenSSL error"), MB_ICONERROR | MB_OK); return 1; } CreateServiceFunction(MS_SYSTEM_GET_SI, GetSslApi); diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index 03740c5813..915301ad6e 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -430,7 +430,7 @@ void SwitchLayout(bool lastword) POPUPDATAT pd = { 0 };
pd.lchIcon = IcoLib_GetIcon("Switch Layout and Send");
mir_wstrncpy(pd.lptzText, buf, _countof(pd.lptzText));
- mir_wstrncpy(pd.lptzContactName, TranslateT("TranslitSwitcher"), _countof(pd.lptzContactName));
+ mir_wstrncpy(pd.lptzContactName, TranslateW_LP(L"TranslitSwitcher"), _countof(pd.lptzContactName));
PUAddPopupT(&pd);
}
}
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 8da20b0d1a..b02a17ae97 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -934,9 +934,4 @@ private: JabberFeatCapPairDynamic *FindFeature(const wchar_t *szFeature);
};
-struct CMPlugin : public ACCPROTOPLUGIN<CJabberProto>
-{
- CMPlugin();
-};
-
#endif
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 36b8b8c8bd..d58e95d5b0 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -110,6 +110,11 @@ struct SESSION_INFO : public GCSessionInfoBase {}; struct CJabberProto;
+struct CMPlugin : public ACCPROTOPLUGIN<CJabberProto>
+{
+ CMPlugin();
+};
+
class CJabberDlgBase : public CProtoDlgBase<CJabberProto>
{
typedef CProtoDlgBase<CJabberProto> CSuper;
diff --git a/src/mir_core/src/CCtrlPages.cpp b/src/mir_core/src/CCtrlPages.cpp index d51b7af35a..f14d43f786 100644 --- a/src/mir_core/src/CCtrlPages.cpp +++ b/src/mir_core/src/CCtrlPages.cpp @@ -214,7 +214,7 @@ void CCtrlPages::InsertPage(TPageInfo *pPage) TCITEM tci = { 0 }; tci.mask = TCIF_PARAM | TCIF_TEXT; tci.lParam = (LPARAM)pPage; - tci.pszText = TranslateW(pPage->m_ptszHeader); + tci.pszText = TranslateW_LP(pPage->m_ptszHeader); if (pPage->m_hIcon) { if (!m_hIml) { m_hIml = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1); @@ -272,7 +272,7 @@ void CCtrlPages::SwapPages(int idx1, int idx2) TCITEM tci = { 0 }; tci.mask = TCIF_PARAM | TCIF_TEXT; tci.lParam = (LPARAM)p1; - tci.pszText = TranslateW(p1->m_ptszHeader); + tci.pszText = TranslateW_LP(p1->m_ptszHeader); TabCtrl_InsertItem(m_hwnd, idx2, &tci); } diff --git a/src/mir_core/src/CCtrlTreeView.cpp b/src/mir_core/src/CCtrlTreeView.cpp index dca6c1b726..4c7daa0cfd 100644 --- a/src/mir_core/src/CCtrlTreeView.cpp +++ b/src/mir_core/src/CCtrlTreeView.cpp @@ -335,7 +335,7 @@ void CCtrlTreeView::TranslateItem(HTREEITEM hItem) TVITEMEX tvi; wchar_t buf[128]; GetItem(hItem, &tvi, buf, _countof(buf)); - tvi.pszText = TranslateW(tvi.pszText); + tvi.pszText = TranslateW_LP(tvi.pszText); SetItem(&tvi); } diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp index 93d5946582..7c7024ba57 100644 --- a/src/mir_core/src/bitmaps.cpp +++ b/src/mir_core/src/bitmaps.cpp @@ -45,5 +45,5 @@ MIR_CORE_DLL(void) Bitmap_GetFilter(wchar_t *dest, size_t destLen) L"%s (*.jpg;*.jpeg)%c*.JPG;*.JPEG%c"
L"%s (*.gif)%c*.GIF%c"
L"%s (*.png)%c*.PNG%c%c",
- TranslateT("All Files"), 0, 0, TranslateT("Windows bitmaps"), 0, 0, TranslateT("JPEG bitmaps"), 0, 0, TranslateT("GIF bitmaps"), 0, 0, TranslateT("PNG bitmaps"), 0, 0, 0);
+ TranslateW_LP(L"All Files"), 0, 0, TranslateW_LP(L"Windows bitmaps"), 0, 0, TranslateW_LP(L"JPEG bitmaps"), 0, 0, TranslateW_LP(L"GIF bitmaps"), 0, 0, TranslateW_LP(L"PNG bitmaps"), 0, 0, 0);
}
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index ffe7fd40f7..bb4ff63b9d 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -503,7 +503,7 @@ MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr) wchar_t *result = (wchar_t*)alloca((len + 1)*sizeof(wchar_t));
MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, pszStr, -1, result, len);
result[len] = 0;
- return mir_wstrdup(TranslateW(result));
+ return mir_wstrdup(TranslateW_LP(result));
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index 80d28cf277..e4f0b50fe8 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -40,9 +40,6 @@ void InitMetaContacts(); void InitTimeZones();
void InitWinver();
-static int _hLang = 0;
-int &hLangpack(_hLang);
-
HINSTANCE g_hInst = nullptr;
HCURSOR g_hCursorNS, g_hCursorWE;
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index db0d4f5a1b..b47cc144b8 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -437,7 +437,7 @@ MIR_CORE_DLL(int) TimeZone_PrepareList(MCONTACT hContact, LPCSTR szModule, HWND if (lstMsg == nullptr)
return 0;
- SendMessage(hWnd, lstMsg->addStr, 0, (LPARAM)TranslateT("<unspecified>"));
+ SendMessage(hWnd, lstMsg->addStr, 0, (LPARAM)TranslateW_LP(L"<unspecified>"));
for (auto &it : g_timezonesBias) {
SendMessage(hWnd, lstMsg->addStr, 0, (LPARAM)it->szDisplay);
diff --git a/utils/mir_options.cpp b/utils/mir_options.cpp index c027b4e7e1..65716a8d16 100644 --- a/utils/mir_options.cpp +++ b/utils/mir_options.cpp @@ -126,7 +126,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) break; case CONTROL_TEXT: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == nullptr ? nullptr : TranslateW(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == nullptr ? nullptr : TranslateW_LP(ctrl->tszDefValue)); break; case CONTROL_INT: @@ -140,7 +140,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) case CONTROL_COMBO_TEXT: case CONTROL_COMBO_ITEMDATA: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == nullptr ? nullptr : TranslateW(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == nullptr ? nullptr : TranslateW_LP(ctrl->tszDefValue)); break; } } @@ -157,7 +157,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha switch (msg) { case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); + TranslateDialog_LP(hwndDlg, 0); for (int i = 0; i < controlsSize; i++) { OptPageControl *ctrl = &controls[i]; @@ -231,7 +231,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha break; case CONTROL_TEXT: - SetDlgItemText(hwndDlg, ctrl->nID, MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == nullptr ? nullptr : TranslateW(ctrl->tszDefValue))); + SetDlgItemText(hwndDlg, ctrl->nID, MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == nullptr ? nullptr : TranslateW_LP(ctrl->tszDefValue))); SendDlgItemMessage(hwndDlg, ctrl->nID, EM_LIMITTEXT, min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), 0); break; @@ -251,12 +251,12 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha break; case CONTROL_COMBO_TEXT: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == nullptr ? nullptr : TranslateW(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == nullptr ? nullptr : TranslateW_LP(ctrl->tszDefValue)); SendDlgItemMessage(hwndDlg, ctrl->nID, CB_SELECTSTRING, 0, (WPARAM)tmp); break; case CONTROL_COMBO_ITEMDATA: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == nullptr ? nullptr : TranslateW(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == nullptr ? nullptr : TranslateW_LP(ctrl->tszDefValue)); { int count = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCOUNT, 0, 0); int k; diff --git a/utils/mir_smileys.cpp b/utils/mir_smileys.cpp index 4ac6703dcf..f683447c88 100644 --- a/utils/mir_smileys.cpp +++ b/utils/mir_smileys.cpp @@ -71,7 +71,7 @@ int InitContactListSmileys() rc.cbSize = sizeof(rc); rc.name = "clist"; - rc.dispname = Translate("Contact List smileys"); + rc.dispname = TranslateA_LP("Contact List smileys"); CallService(MS_SMILEYADD_REGISTERCATEGORY, 0, (LPARAM)&rc); } |