From 397d070df1e8b0f208cc148371d3fd56f314afc6 Mon Sep 17 00:00:00 2001 From: George Hazan <ghazan@miranda.im> Date: Tue, 19 Feb 2019 23:02:20 +0300 Subject: TranslateU applied to Jabber --- protocols/JabberG/src/jabber_adhoc.cpp | 16 +++---- protocols/JabberG/src/jabber_chat.cpp | 12 ++--- protocols/JabberG/src/jabber_form.cpp | 2 +- protocols/JabberG/src/jabber_groupchat.cpp | 4 +- protocols/JabberG/src/jabber_opt.cpp | 2 +- protocols/JabberG/src/jabber_privacy.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 8 ++-- protocols/JabberG/src/jabber_rc.cpp | 76 +++++++++++++++--------------- protocols/JabberG/src/jabber_search.cpp | 4 +- protocols/JabberG/src/jabber_thread.cpp | 2 +- protocols/JabberG/src/jabber_userinfo.cpp | 28 +++++------ src/mir_core/src/langpack.cpp | 2 +- 12 files changed, 79 insertions(+), 79 deletions(-) diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index d958721e2b..61fa07179d 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -145,7 +145,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, TiXmlElement *iqNo description = errorNode->GetText(); } - JabberFormSetInstruction(hwndDlg, CMStringA(FORMAT, Translate("Error %s %s"), code, description)); + JabberFormSetInstruction(hwndDlg, CMStringA(FORMAT, TranslateU("Error %s %s"), code, description)); } else if (!mir_strcmp(type, "result")) { BOOL validResponse = FALSE; @@ -174,12 +174,12 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, TiXmlElement *iqNo } if (nodeIdx > 1) { - JabberFormSetInstruction(hwndDlg, Translate("Select Command")); + JabberFormSetInstruction(hwndDlg, TranslateU("Select Command")); ShowDlgItem(hwndDlg, IDC_FRAME, SW_SHOW); ShowDlgItem(hwndDlg, IDC_VSCROLL, SW_SHOW); EnableDlgItem(hwndDlg, IDC_SUBMIT, TRUE); } - else JabberFormSetInstruction(hwndDlg, Translate("Not supported")); + else JabberFormSetInstruction(hwndDlg, TranslateU("Not supported")); } JabberAdHoc_RefreshFrameScroll(hwndDlg, dat); @@ -219,7 +219,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, TiXmlElement *workNode else if (pszText = XmlGetChildText(xNode, "title")) JabberFormSetInstruction(hwndDlg, pszText); else - JabberFormSetInstruction(hwndDlg, Translate(status)); + JabberFormSetInstruction(hwndDlg, TranslateU(status)); JabberFormCreateUI(hFrame, xNode, &dat->CurrentHeight); ShowDlgItem(hwndDlg, IDC_FRAME, SW_SHOW); } @@ -229,7 +229,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, TiXmlElement *workNode sttShowControls(hwndDlg, FALSE, toHide); auto *pszText = XmlGetChildText(commandNode, "note"); - JabberFormSetInstruction(hwndDlg, pszText ? pszText : Translate(status)); + JabberFormSetInstruction(hwndDlg, pszText ? pszText : TranslateU(status)); } // check actions @@ -269,7 +269,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, TiXmlElement *workNode description = errorNode->GetText(); } - JabberFormSetInstruction(hwndDlg, CMStringA(FORMAT, Translate("Error %s %s"), code, description)); + JabberFormSetInstruction(hwndDlg, CMStringA(FORMAT, TranslateU("Error %s %s"), code, description)); } JabberAdHoc_RefreshFrameScroll(hwndDlg, dat); return TRUE; @@ -299,7 +299,7 @@ int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData *dat, ch command->InsertEndChild(dataNode); m_ThreadInfo->send(iq); - JabberFormSetInstruction(hwndDlg, Translate("In progress. Please Wait...")); + JabberFormSetInstruction(hwndDlg, TranslateU("In progress. Please Wait...")); static const int toDisable[] = { IDC_SUBMIT, IDC_PREV, IDC_NEXT, IDC_COMPLETE, 0 }; sttEnableControls(hwndDlg, FALSE, toDisable); @@ -364,7 +364,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA SetWindowPos(GetDlgItem(hwndDlg, IDC_VSCROLL), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); SetDlgItemText(hwndDlg, IDC_SUBMIT, TranslateT("Execute")); - JabberFormSetInstruction(hwndDlg, Translate("Requesting command list. Please wait...")); + JabberFormSetInstruction(hwndDlg, TranslateU("Requesting command list. Please wait...")); if (!pStartupParams->m_szNode) { dat->proto->AdHoc_RequestListOfCommands(pStartupParams->m_szJid, hwndDlg); diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index ac1a145931..73942a6398 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -249,9 +249,9 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const char *r const char *szReason = (reason) ? reason->GetText() : nullptr; if (szReason == nullptr) { if (nStatusCode == 322) - szReason = Translate("because room is now members-only"); + szReason = TranslateU("because room is now members-only"); else if (nStatusCode == 301) - szReason = Translate("user banned"); + szReason = TranslateU("user banned"); } ptrA myNick(mir_strdup(item->nick)); @@ -321,7 +321,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, const TiXmlElement * if (quitMessage != nullptr) szMessage = quitMessage; else - szMessage = Translate(JABBER_GC_MSG_QUIT); + szMessage = TranslateU(JABBER_GC_MSG_QUIT); } else { ptrA myNick(JabberNickFromJID(m_szJabberJID)); @@ -846,11 +846,11 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)Skin_LoadProtoIcon(dat->ppro->m_szModuleName, dat->him->m_iStatus), 0); char buf[256]; - mir_snprintf(buf, Translate("%s from\n%s"), dat->him->m_szResourceName, dat->item->jid); + mir_snprintf(buf, TranslateU("%s from\n%s"), dat->him->m_szResourceName, dat->item->jid); SetDlgItemTextUtf(hwndDlg, IDC_HEADERBAR, buf); SetDlgItemTextUtf(hwndDlg, IDC_TXT_NICK, dat->him->m_szResourceName); - SetDlgItemTextUtf(hwndDlg, IDC_TXT_JID, dat->him->m_szRealJid ? dat->him->m_szRealJid : Translate("Real JID not available")); + SetDlgItemTextUtf(hwndDlg, IDC_TXT_JID, dat->him->m_szRealJid ? dat->him->m_szRealJid : TranslateU("Real JID not available")); SetDlgItemTextUtf(hwndDlg, IDC_TXT_STATUS, dat->him->m_szStatusMessage); for (auto &it : sttRoleItems) { @@ -999,7 +999,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (ppro->m_bJabberOnline) { ptrA szMessage(ppro->getUStringA("GcMsgSlap")); if (szMessage == nullptr) - szMessage = mir_strdup(Translate(JABBER_GC_MSG_SLAP)); + szMessage = mir_strdup(TranslateU(JABBER_GC_MSG_SLAP)); CMStringA buf; // do not use snprintf to avoid possible problems with % symbol diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index 440bf89a57..e3366258eb 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -661,7 +661,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, else if (pszText = XmlGetChildText(jfi->xNode, "title")) JabberFormSetInstruction(hwndDlg, pszText); else - JabberFormSetInstruction(hwndDlg, Translate(T2Utf(jfi->defTitle))); + JabberFormSetInstruction(hwndDlg, TranslateU(T2Utf(jfi->defTitle))); // Create form if (jfi->xNode != nullptr) { diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index e412c42c3a..682de9e84a 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -457,7 +457,7 @@ public: break; char jid[JABBER_MAX_JID_LEN]; - mir_snprintf(jid, "%s@%s (%s)", info.m_room, info.m_server, info.m_nick ? info.m_nick : Translate("<no nick>")); + mir_snprintf(jid, "%s@%s (%s)", info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateU("<no nick>")); SetDlgItemTextUtf(m_hwnd, IDC_RECENT1 + i, jid); } sttJoinDlgShowRecentItems(m_hwnd, i); @@ -1045,7 +1045,7 @@ void CJabberProto::GroupchatProcessMessage(const TiXmlElement *node) const char *tmptr = strstr(tmpnick, "has set the subject to:"); //ejabberd if (tmptr == nullptr) - tmptr = strstr(tmpnick, Translate("has set the subject to:")); //ejabberd + tmptr = strstr(tmpnick, TranslateU("has set the subject to:")); //ejabberd if (tmptr != nullptr && *tmptr != 0) { *(wchar_t*)(--tmptr) = 0; resource = tmpnick; diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 4ca81ab92e..22b869ddc4 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -245,7 +245,7 @@ public: bool OnInitDialog() override { - CMStringA text(FORMAT, "%s %s@%s:%d?", Translate("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port); + CMStringA text(FORMAT, "%s %s@%s:%d?", TranslateU("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port); SetDlgItemTextUtf(m_hwnd, IDC_REG_STATUS, text); return true; } diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 35a8b3cbfd..589fae2204 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -889,7 +889,7 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase if (!pList) { if (!szActive) bActive = true; if (!szDefault) bDefault = true; - szName = Translate("<none>"); + szName = TranslateU("<none>"); } else { if (!mir_strcmp(pList->GetListName(), szActive)) bActive = true; diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index d67356d965..79aa5a8a90 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -915,13 +915,13 @@ HANDLE CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, w struct TFakeAckParams { - inline TFakeAckParams(MCONTACT _hContact, const char* _msg, int _msgid = 0) + inline TFakeAckParams(MCONTACT _hContact, const wchar_t *_msg, int _msgid = 0) : hContact(_hContact), msg(_msg), msgid(_msgid) { } MCONTACT hContact; - const char *msg; + const wchar_t *msg; int msgid; }; @@ -943,7 +943,7 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz { char szClientJid[JABBER_MAX_JID_LEN]; if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, _countof(szClientJid))) { - TFakeAckParams *param = new TFakeAckParams(hContact, Translate("Protocol is offline or no JID")); + TFakeAckParams *param = new TFakeAckParams(hContact, TranslateT("Protocol is offline or no JID")); ForkThread(&CJabberProto::SendMessageAckThread, param); return 1; } @@ -981,7 +981,7 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz if (m_bUseOMEMO && OmemoIsEnabled(hContact) && !mir_strcmp(msgType, "chat")) { // TODO: check if message encrypted for at least one session and return error if not if (!OmemoEncryptMessage(m, pszSrc, hContact)) { - TFakeAckParams *param = new TFakeAckParams(hContact, Translate("No valid OMEMO session exists")); + TFakeAckParams *param = new TFakeAckParams(hContact, TranslateT("No valid OMEMO session exists")); ForkThread(&CJabberProto::SendMessageAckThread, param); return 0; } diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index a3e1646f1c..4d37c97b03 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -193,7 +193,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(const TiXmlElement *iqNode, CJabb XmlNodeIq("result", pInfo) << XCHILDNS("command", JABBER_FEAT_COMMANDS) << XATTR("node", szNode) << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "completed") - << XCHILD("note", Translate("Command completed successfully")) << XATTR("type", "info")); + << XCHILD("note", TranslateU("Command completed successfully")) << XATTR("type", "info")); RemoveSession(pSession); pSession = nullptr; @@ -203,7 +203,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(const TiXmlElement *iqNode, CJabb XmlNodeIq("result", pInfo) << XCHILDNS("command", JABBER_FEAT_COMMANDS) << XATTR("node", szNode) << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "canceled") - << XCHILD("note", Translate("Error occurred during processing command")) << XATTR("type", "error")); + << XCHILD("note", TranslateU("Error occurred during processing command")) << XATTR("type", "error")); RemoveSession(pSession); pSession = nullptr; @@ -218,12 +218,12 @@ BOOL CJabberAdhocManager::HandleCommandRequest(const TiXmlElement *iqNode, CJabb BOOL CJabberAdhocManager::FillDefaultNodes() { - AddNode(nullptr, JABBER_FEAT_RC_SET_STATUS, Translate("Set status"), &CJabberProto::AdhocSetStatusHandler); - AddNode(nullptr, JABBER_FEAT_RC_SET_OPTIONS, Translate("Set options"), &CJabberProto::AdhocOptionsHandler); - AddNode(nullptr, JABBER_FEAT_RC_FORWARD, Translate("Forward unread messages"), &CJabberProto::AdhocForwardHandler); - AddNode(nullptr, JABBER_FEAT_RC_LEAVE_GROUPCHATS, Translate("Leave group chats"), &CJabberProto::AdhocLeaveGroupchatsHandler); - AddNode(nullptr, JABBER_FEAT_RC_WS_LOCK, Translate("Lock workstation"), &CJabberProto::AdhocLockWSHandler); - AddNode(nullptr, JABBER_FEAT_RC_QUIT_MIRANDA, Translate("Quit Miranda NG"), &CJabberProto::AdhocQuitMirandaHandler); + AddNode(nullptr, JABBER_FEAT_RC_SET_STATUS, TranslateU("Set status"), &CJabberProto::AdhocSetStatusHandler); + AddNode(nullptr, JABBER_FEAT_RC_SET_OPTIONS, TranslateU("Set options"), &CJabberProto::AdhocOptionsHandler); + AddNode(nullptr, JABBER_FEAT_RC_FORWARD, TranslateU("Forward unread messages"), &CJabberProto::AdhocForwardHandler); + AddNode(nullptr, JABBER_FEAT_RC_LEAVE_GROUPCHATS, TranslateU("Leave group chats"), &CJabberProto::AdhocLeaveGroupchatsHandler); + AddNode(nullptr, JABBER_FEAT_RC_WS_LOCK, TranslateU("Lock workstation"), &CJabberProto::AdhocLockWSHandler); + AddNode(nullptr, JABBER_FEAT_RC_QUIT_MIRANDA, TranslateU("Quit Miranda NG"), &CJabberProto::AdhocQuitMirandaHandler); return TRUE; } @@ -263,13 +263,13 @@ int CJabberProto::AdhocSetStatusHandler(const TiXmlElement*, CJabberIqInfo *pInf << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "executing") << XCHILDNS("x", JABBER_FEAT_DATA_FORMS) << XATTR("type", "form"); - xNode << XCHILD("title", Translate("Change Status")); - xNode << XCHILD("instructions", Translate("Choose the status and status message")); + xNode << XCHILD("title", TranslateU("Change Status")); + xNode << XCHILD("instructions", TranslateU("Choose the status and status message")); xNode << XCHILD("field") << XATTR("type", "hidden") << XATTR("var", "FORM_TYPE") << XATTR("value", JABBER_FEAT_RC); - TiXmlElement *fieldNode = xNode << XCHILD("field") << XATTR("label", Translate("Status")) + TiXmlElement *fieldNode = xNode << XCHILD("field") << XATTR("label", TranslateU("Status")) << XATTR("type", "list-single") << XATTR("var", "status"); fieldNode << XCHILD("required"); @@ -300,26 +300,26 @@ int CJabberProto::AdhocSetStatusHandler(const TiXmlElement*, CJabberIqInfo *pInf break; } - fieldNode << XCHILD("option") << XATTR("label", Translate("Free for chat")) << XCHILD("value", "chat"); - fieldNode << XCHILD("option") << XATTR("label", Translate("Online")) << XCHILD("value", "online"); - fieldNode << XCHILD("option") << XATTR("label", Translate("Away")) << XCHILD("value", "away"); - fieldNode << XCHILD("option") << XATTR("label", Translate("Extended away (Not available)")) << XCHILD("value", "xa"); - fieldNode << XCHILD("option") << XATTR("label", Translate("Do not disturb")) << XCHILD("value", "dnd"); - fieldNode << XCHILD("option") << XATTR("label", Translate("Invisible")) << XCHILD("value", "invisible"); - fieldNode << XCHILD("option") << XATTR("label", Translate("Offline")) << XCHILD("value", "offline"); + fieldNode << XCHILD("option") << XATTR("label", TranslateU("Free for chat")) << XCHILD("value", "chat"); + fieldNode << XCHILD("option") << XATTR("label", TranslateU("Online")) << XCHILD("value", "online"); + fieldNode << XCHILD("option") << XATTR("label", TranslateU("Away")) << XCHILD("value", "away"); + fieldNode << XCHILD("option") << XATTR("label", TranslateU("Extended away (Not available)")) << XCHILD("value", "xa"); + fieldNode << XCHILD("option") << XATTR("label", TranslateU("Do not disturb")) << XCHILD("value", "dnd"); + fieldNode << XCHILD("option") << XATTR("label", TranslateU("Invisible")) << XCHILD("value", "invisible"); + fieldNode << XCHILD("option") << XATTR("label", TranslateU("Offline")) << XCHILD("value", "offline"); // priority char szPriority[20]; itoa(getDword("Priority", 5), szPriority, 10); - xNode << XCHILD("field") << XATTR("label", Translate("Priority")) << XATTR("type", "text-single") + xNode << XCHILD("field") << XATTR("label", TranslateU("Priority")) << XATTR("type", "text-single") << XATTR("var", "status-priority") << XCHILD("value", szPriority); // status message text - xNode << XCHILD("field") << XATTR("label", Translate("Status message")) + xNode << XCHILD("field") << XATTR("label", TranslateU("Status message")) << XATTR("type", "text-multi") << XATTR("var", "status-message"); // global status - fieldNode = xNode << XCHILD("field") << XATTR("label", Translate("Change global status")) + fieldNode = xNode << XCHILD("field") << XATTR("label", TranslateU("Change global status")) << XATTR("type", "boolean") << XATTR("var", "status-global"); ptrW tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, 0)); @@ -405,8 +405,8 @@ int CJabberProto::AdhocOptionsHandler(const TiXmlElement*, CJabberIqInfo *pInfo, << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "executing") << XCHILDNS("x", JABBER_FEAT_DATA_FORMS) << XATTR("type", "form"); - xNode << XCHILD("title", Translate("Set Options")); - xNode << XCHILD("instructions", Translate("Set the desired options")); + xNode << XCHILD("title", TranslateU("Set Options")); + xNode << XCHILD("instructions", TranslateU("Set the desired options")); xNode << XCHILD("field") << XATTR("type", "hidden") << XATTR("var", "FORM_TYPE") << XATTR("value", JABBER_FEAT_RC); @@ -414,16 +414,16 @@ int CJabberProto::AdhocOptionsHandler(const TiXmlElement*, CJabberIqInfo *pInfo, // Automatically Accept File Transfers char szTmpBuff[20]; _itoa_s(db_get_b(0, "SRFile", "AutoAccept", 0), szTmpBuff, 10); - xNode << XCHILD("field") << XATTR("label", Translate("Automatically Accept File Transfers")) + xNode << XCHILD("field") << XATTR("label", TranslateU("Automatically Accept File Transfers")) << XATTR("type", "boolean") << XATTR("var", "auto-files") << XCHILD("value", szTmpBuff); // Use sounds _itoa_s(db_get_b(0, "Skin", "UseSound", 0), szTmpBuff, 10); - xNode << XCHILD("field") << XATTR("label", Translate("Play sounds")) + xNode << XCHILD("field") << XATTR("label", TranslateU("Play sounds")) << XATTR("type", "boolean") << XATTR("var", "sounds") << XCHILD("value", szTmpBuff); // Disable remote controlling - xNode << XCHILD("field") << XATTR("label", Translate("Disable remote controlling (check twice what you are doing)")) + xNode << XCHILD("field") << XATTR("label", TranslateU("Disable remote controlling (check twice what you are doing)")) << XATTR("type", "boolean") << XATTR("var", "enable-rc") << XCHILD("value", "0"); m_ThreadInfo->send(iq); @@ -491,7 +491,7 @@ int CJabberProto::AdhocForwardHandler(const TiXmlElement*, CJabberIqInfo *pInfo, XmlNodeIq("result", pInfo) << XCHILDNS("command", JABBER_FEAT_COMMANDS) << XATTR("node", JABBER_FEAT_RC_FORWARD) << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "completed") - << XCHILD("note", Translate("There is no messages to forward")) << XATTR("type", "info")); + << XCHILD("note", TranslateU("There is no messages to forward")) << XATTR("type", "info")); return JABBER_ADHOC_HANDLER_STATUS_REMOVE_SESSION; } @@ -505,17 +505,17 @@ int CJabberProto::AdhocForwardHandler(const TiXmlElement*, CJabberIqInfo *pInfo, << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "executing") << XCHILDNS("x", JABBER_FEAT_DATA_FORMS) << XATTR("type", "form"); - xNode << XCHILD("title", Translate("Forward options")); + xNode << XCHILD("title", TranslateU("Forward options")); char szMsg[1024]; - mir_snprintf(szMsg, Translate("%d message(s) to be forwarded"), nUnreadEvents); + mir_snprintf(szMsg, TranslateU("%d message(s) to be forwarded"), nUnreadEvents); xNode << XCHILD("instructions", szMsg); xNode << XCHILD("field") << XATTR("type", "hidden") << XATTR("var", "FORM_TYPE") << XCHILD("value", JABBER_FEAT_RC); // remove clist events - xNode << XCHILD("field") << XATTR("label", Translate("Mark messages as read")) << XATTR("type", "boolean") + xNode << XCHILD("field") << XATTR("label", TranslateU("Mark messages as read")) << XATTR("type", "boolean") << XATTR("var", "remove-clist-events") << XCHILD("value", m_bRcMarkMessagesAsRead == 1 ? "1" : "0"); m_ThreadInfo->send(iq); @@ -599,7 +599,7 @@ int CJabberProto::AdhocForwardHandler(const TiXmlElement*, CJabberIqInfo *pInfo, XmlNodeIq("result", pInfo) << XCHILDNS("command", JABBER_FEAT_COMMANDS) << XATTR("node", JABBER_FEAT_RC_FORWARD) << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "completed") - << XCHILD("note", CMStringA(FORMAT, Translate("%d message(s) forwarded"), nEventsSent)) << XATTR("type", "info")); + << XCHILD("note", CMStringA(FORMAT, TranslateU("%d message(s) forwarded"), nEventsSent)) << XATTR("type", "info")); return JABBER_ADHOC_HANDLER_STATUS_REMOVE_SESSION; } @@ -613,9 +613,9 @@ int CJabberProto::AdhocLockWSHandler(const TiXmlElement*, CJabberIqInfo *pInfo, char szMsg[1024]; if (bOk) - mir_snprintf(szMsg, Translate("Workstation successfully locked")); + mir_snprintf(szMsg, TranslateU("Workstation successfully locked")); else - mir_snprintf(szMsg, Translate("Error %d occurred during workstation lock"), GetLastError()); + mir_snprintf(szMsg, TranslateU("Error %d occurred during workstation lock"), GetLastError()); m_ThreadInfo->send( XmlNodeIq("result", pInfo) @@ -643,8 +643,8 @@ int CJabberProto::AdhocQuitMirandaHandler(const TiXmlElement*, CJabberIqInfo *pI << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "executing") << XCHILDNS("x", JABBER_FEAT_DATA_FORMS) << XATTR("type", "form"); - xNode << XCHILD("title", Translate("Confirmation needed")); - xNode << XCHILD("instructions", Translate("Please confirm Miranda NG shutdown")); + xNode << XCHILD("title", TranslateU("Confirmation needed")); + xNode << XCHILD("instructions", TranslateU("Please confirm Miranda NG shutdown")); xNode << XCHILD("field") << XATTR("type", "hidden") << XATTR("var", "FORM_TYPE") << XCHILD("value", JABBER_FEAT_RC); @@ -695,7 +695,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(const TiXmlElement*, CJabberIqInfo XmlNodeIq("result", pInfo) << XCHILDNS("command", JABBER_FEAT_COMMANDS) << XATTR("node", JABBER_FEAT_RC_LEAVE_GROUPCHATS) << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "completed") - << XCHILD("note", Translate("There is no group chats to leave")) << XATTR("type", "info")); + << XCHILD("note", TranslateU("There is no group chats to leave")) << XATTR("type", "info")); return JABBER_ADHOC_HANDLER_STATUS_REMOVE_SESSION; } @@ -708,8 +708,8 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(const TiXmlElement*, CJabberIqInfo << XATTR("sessionid", pSession->GetSessionId()) << XATTR("status", "executing") << XCHILDNS("x", JABBER_FEAT_DATA_FORMS) << XATTR("type", "form"); - xNode << XCHILD("title", Translate("Leave group chats")); - xNode << XCHILD("instructions", Translate("Choose the group chats you want to leave")); + xNode << XCHILD("title", TranslateU("Leave group chats")); + xNode << XCHILD("instructions", TranslateU("Choose the group chats you want to leave")); xNode << XCHILD("field") << XATTR("type", "hidden") << XATTR("var", "FORM_TYPE") << XATTR("value", JABBER_FEAT_RC); diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 99d77d6c38..5d7b2f1f1a 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -189,7 +189,7 @@ void CJabberProto::OnIqResultGetSearchFields(const TiXmlElement *iqNode, CJabber } char buff[255]; - mir_snprintf(buff, Translate("Error %s %s\r\nPlease select other server"), code, description); + mir_snprintf(buff, TranslateU("Error %s %s\r\nPlease select other server"), code, description); SetDlgItemTextUtf(searchHandleDlg, IDC_INSTRUCTIONS, buff); } else SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateT("Error: unknown reply received\r\nPlease select other server")); @@ -375,7 +375,7 @@ void CJabberProto::OnIqResultAdvancedSearch(const TiXmlElement *iqNode, CJabberI ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0); char buff[255]; - mir_snprintf(buff, Translate("Error %s %s\r\nTry to specify more detailed"), code, description); + mir_snprintf(buff, TranslateU("Error %s %s\r\nTry to specify more detailed"), code, description); if (searchHandleDlg) SetDlgItemTextUtf(searchHandleDlg, IDC_INSTRUCTIONS, buff); else diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index fc38cb09e9..31e1330e60 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1135,7 +1135,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) if (addressNode) { const char *szJid = addressNode->Attribute("jid"); if (szJid) { - szMessage.AppendFormat(Translate("Message redirected from: %s\r\n"), from); + szMessage.AppendFormat(TranslateU("Message redirected from: %s\r\n"), from); from = szJid; // rewrite hContact hContact = HContactFromJID(from); diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 6e024052b8..13ef901a18 100755 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -263,9 +263,9 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti buf[len - 1] = 0; } else if (!r->m_dwIdleStartTime) - mir_strncpy(buf, Translate("unknown"), _countof(buf)); + mir_strncpy(buf, TranslateU("unknown"), _countof(buf)); else - mir_strncpy(buf, Translate("<not specified>"), _countof(buf)); + mir_strncpy(buf, TranslateU("<not specified>"), _countof(buf)); sttFillInfoLine(hwndTree, htiResource, nullptr, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE)); @@ -274,13 +274,13 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti JabberCapsBits jcb = ppro->GetResourceCapabilities(buf, r); if (!(jcb & JABBER_RESOURCE_CAPS_ERROR)) { - HTREEITEM htiCaps = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, Translate("Client capabilities"), sttInfoLineId(resource, INFOLINE_CAPS)); + HTREEITEM htiCaps = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, TranslateU("Client capabilities"), sttInfoLineId(resource, INFOLINE_CAPS)); int i; for (i = 0; i < g_cJabberFeatCapPairs; i++) if (jcb & g_JabberFeatCapPairs[i].jcbCap) { char szDescription[1024]; if (g_JabberFeatCapPairs[i].tszDescription) - mir_snprintf(szDescription, "%s (%s)", Translate(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature); + mir_snprintf(szDescription, "%s (%s)", TranslateU(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature); else strncpy_s(szDescription, g_JabberFeatCapPairs[i].szFeature, _TRUNCATE); sttFillInfoLine(hwndTree, htiCaps, nullptr, nullptr, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); @@ -290,7 +290,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti if (jcb & it->jcbCap) { char szDescription[1024]; if (it->szDescription) - mir_snprintf(szDescription, "%s (%s)", Translate(it->szDescription), it->szFeature); + mir_snprintf(szDescription, "%s (%s)", TranslateU(it->szDescription), it->szFeature); else strncpy_s(szDescription, it->szFeature, _TRUNCATE); sttFillInfoLine(hwndTree, htiCaps, nullptr, nullptr, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i++)); @@ -299,7 +299,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti } // Software info - HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, Translate("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION)); + HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, TranslateU("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION)); int nLineId = 0; if (CJabberClientPartialCaps *pCaps = r->m_pCaps) { if (pCaps->GetOs()) @@ -352,16 +352,16 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM // subscription switch (item->subscription) { case SUB_BOTH: - sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), Translate("both"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); + sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), TranslateU("both"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); break; case SUB_TO: - sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), Translate("to"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); + sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), TranslateU("to"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); break; case SUB_FROM: - sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), Translate("from"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); + sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), TranslateU("from"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); break; default: - sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), Translate("none"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); + sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Subscription"), TranslateU("none"), sttInfoLineId(0, INFOLINE_SUBSCRIPTION)); break; } @@ -375,9 +375,9 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM buf[len - 1] = 0; } else if (!r->m_dwIdleStartTime) - mir_strncpy(buf, Translate("unknown"), _countof(buf)); + mir_strncpy(buf, TranslateU("unknown"), _countof(buf)); else - mir_strncpy(buf, Translate("<not specified>"), _countof(buf)); + mir_strncpy(buf, TranslateU("<not specified>"), _countof(buf)); sttFillInfoLine(hwndTree, htiRoot, nullptr, (item->jid && strchr(item->jid, '@')) ? TranslateT("Last logoff time") : TranslateT("Uptime"), buf, @@ -389,7 +389,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM if (item->m_pLastSeenResource) mir_strncpy(buf, item->m_pLastSeenResource->m_szResourceName, _countof(buf)); else - mir_strncpy(buf, Translate("<no information available>"), _countof(buf)); + mir_strncpy(buf, TranslateU("<no information available>"), _countof(buf)); sttFillInfoLine(hwndTree, htiRoot, nullptr, TranslateT("Last active resource"), buf, sttInfoLineId(0, INFOLINE_LASTACTIVE)); // resources @@ -483,7 +483,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO); TreeView_DeleteAllItems(hwndTree); HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, dat->ppro->LoadIconEx("main"), L"JID", jid, sttInfoLineId(0, INFOLINE_NAME), true); - sttFillInfoLine(hwndTree, htiRoot, dat->ppro->LoadIconEx("vcard"), nullptr, Translate("Please switch online to see more details.")); + sttFillInfoLine(hwndTree, htiRoot, dat->ppro->LoadIconEx("vcard"), nullptr, TranslateU("Please switch online to see more details.")); break; } } diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 0532f58e4a..ed16e79328 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -284,7 +284,7 @@ static void LoadLangPackFile(FILE *fp, char *line) LangPackEntry *E = &g_pEntries[g_entryCount - 1]; E->englishHash = mir_hashstr(pszLine); - E->szLocal = nullptr; + E->szLocal = E->utfLocal = nullptr; E->wszLocal = nullptr; E->pMuuid = pCurrentMuuid; E->pNext = nullptr; -- cgit v1.2.3