From 104f1a0882ee3c867056fb215d6e08658c5f9c48 Mon Sep 17 00:00:00 2001 From: George Hazan <ghazan@miranda.im> Date: Fri, 22 Sep 2017 15:07:07 +0300 Subject: attempt to fix #935 --- include/m_chat.h | 2 +- protocols/AimOscar/src/chat.cpp | 14 +++++++------- src/mir_app/src/chat_tools.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/m_chat.h b/include/m_chat.h index ad715b1fbc..b4cac396df 100644 --- a/include/m_chat.h +++ b/include/m_chat.h @@ -539,7 +539,7 @@ typedef struct { #define ME_GC_BUILDMENU "GChat/BuildMenu" -EXTERN_C MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item); +EXTERN_C MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item, int = hLangpack); ////////////////////////////////////////////////////////////////////////// // Get Chat ToolTip Text for buddy diff --git a/protocols/AimOscar/src/chat.cpp b/protocols/AimOscar/src/chat.cpp index 7071c9a3da..75940fdd18 100644 --- a/protocols/AimOscar/src/chat.cpp +++ b/protocols/AimOscar/src/chat.cpp @@ -166,8 +166,8 @@ int CAimProto::OnGCMenuHook(WPARAM, LPARAM lParam) if (gcmi->Type == MENU_ON_LOG) { static const struct gc_item Items[] = { - { TranslateT("&Invite user..."), 10, MENU_ITEM, FALSE }, - { TranslateT("&Leave chat session"), 20, MENU_ITEM, FALSE } + { LPGENW("&Invite user..."), 10, MENU_ITEM, FALSE }, + { LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE } }; Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items); } @@ -175,17 +175,17 @@ int CAimProto::OnGCMenuHook(WPARAM, LPARAM lParam) char* sn = mir_u2a(gcmi->pszUID); if (!mir_strcmp(m_username, sn)) { static const struct gc_item Items[] = { - { TranslateT("User &details"), 10, MENU_ITEM, FALSE }, - { TranslateT("User &history"), 20, MENU_ITEM, FALSE }, + { LPGENW("User &details"), 10, MENU_ITEM, FALSE }, + { LPGENW("User &history"), 20, MENU_ITEM, FALSE }, { L"", 100, MENU_SEPARATOR, FALSE }, - { TranslateT("&Leave chat session"), 110, MENU_ITEM, FALSE } + { LPGENW("&Leave chat session"), 110, MENU_ITEM, FALSE } }; Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items); } else { static const struct gc_item Items[] = { - { TranslateT("User &details"), 10, MENU_ITEM, FALSE }, - { TranslateT("User &history"), 20, MENU_ITEM, FALSE } + { LPGENW("User &details"), 10, MENU_ITEM, FALSE }, + { LPGENW("User &history"), 20, MENU_ITEM, FALSE } }; Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items); } diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 2d098c0e30..e3869a7097 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -750,14 +750,14 @@ MIR_APP_DLL(wchar_t*) Chat_UnescapeTags(wchar_t *str_in) ///////////////////////////////////////////////////////////////////////////////////////// -MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item) +MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item, int _hLang) { if (nItems > 0) AppendMenu(hMenu, MF_SEPARATOR, 0, 0); HMENU hSubMenu = nullptr; for (int i = 0; i < nItems; i++) { - wchar_t *ptszText = TranslateW(Item[i].pszDesc); + wchar_t *ptszText = TranslateW_LP(Item[i].pszDesc, _hLang); DWORD dwState = Item[i].bDisabled ? MF_GRAYED : 0; if (Item[i].uType == MENU_NEWPOPUP) { -- cgit v1.2.3