From e2552ec6737fe734ffd5b4768193c6a890d66f70 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 6 Sep 2011 17:45:47 +0300 Subject: STORM-1577 WIP Implemented translation via Microsoft Translator and Google Translate v2 APIs. --- indra/newview/llviewermessage.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 68745d5aeb..ff02214194 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3138,7 +3138,7 @@ protected: { // filter out non-interesting responeses if ( !translation.empty() - && (m_toLang != detected_language) + && (mToLang != detected_language) && (LLStringUtil::compareInsensitive(translation, m_origMesg) != 0) ) { m_chat.mText += " (" + translation + ")"; @@ -3147,9 +3147,8 @@ protected: LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs); } - void handleFailure() + void handleFailure(int status, const std::string& err_msg) { - LLTranslate::TranslationReceiver::handleFailure(); m_chat.mText += " (?)"; LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs); @@ -3388,7 +3387,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) const std::string from_lang = ""; // leave empty to trigger autodetect const std::string to_lang = LLTranslate::getTranslateLanguage(); - LLHTTPClient::ResponderPtr result = ChatTranslationReceiver::build(from_lang, to_lang, mesg, chat, args); + LLTranslate::TranslationReceiverPtr result = ChatTranslationReceiver::build(from_lang, to_lang, mesg, chat, args); LLTranslate::translateMessage(result, from_lang, to_lang, mesg); } else -- cgit v1.2.3 From d6c8d3dca8cad5d904d3fd4d6eb85ef2a76c0931 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 13 Sep 2011 03:20:58 +0300 Subject: STORM-1577 WIP Show translation errors in chat. --- indra/newview/llviewermessage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ff02214194..0eae6e6383 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3149,7 +3149,9 @@ protected: void handleFailure(int status, const std::string& err_msg) { - m_chat.mText += " (?)"; + std::string msg = LLTrans::getString("TranslationFailed", LLSD().with("[REASON]", err_msg)); + LLStringUtil::replaceString(msg, "\n", " "); // we want one-line error messages + m_chat.mText += " (" + msg + ")"; LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs); } -- cgit v1.2.3 From e32227e90b8911200bfd103ff466ddb9231c6619 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 21 Oct 2011 13:49:35 -0400 Subject: SH-2557 WIP - some cleanup, added error message to try to isolate causes of translation failure --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/llviewermessage.cpp (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp old mode 100644 new mode 100755 index 369d2d757d..04b901ed0e --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3129,7 +3129,7 @@ protected: void handleFailure() { - LLTranslate::TranslationReceiver::handleFailure(); + llwarns << "translation failed for mesg " << m_origMesg << llendl; m_chat.mText += " (?)"; LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs); -- cgit v1.2.3 From cc719670d9ae9c2793f291dd4a3fd9f0118b5876 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 21 Oct 2011 17:54:34 -0400 Subject: SH-2557 WIP - more warning message details --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 04b901ed0e..3eed7edafa 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3129,7 +3129,7 @@ protected: void handleFailure() { - llwarns << "translation failed for mesg " << m_origMesg << llendl; + llwarns << "translation failed for mesg " << m_origMesg << " toLang " << m_toLang << " fromLang " << m_fromLang << llendl; m_chat.mText += " (?)"; LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs); -- cgit v1.2.3