summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-11-15 17:04:37 -0600
committerDave Parks <davep@lindenlab.com>2011-11-15 17:04:37 -0600
commitcfb666e9d9eb8945a79e2f7999459267caca36ee (patch)
treeb02e73c02f6f377c99fffc950d72525516647f52 /indra/newview/llviewermessage.cpp
parent09c74484ae0df267f01610ab4b594e50a01c05c1 (diff)
parentb493b8cca491c4b7a76f4c98b34272970d3bb58b (diff)
merge
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 65b569a190..a9ca70fd26 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3121,7 +3121,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 + ")";
@@ -3130,10 +3130,13 @@ protected:
LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs);
}
- void handleFailure()
+ void handleFailure(int status, const std::string& err_msg)
{
- llwarns << "translation failed for mesg " << m_origMesg << " toLang " << m_toLang << " fromLang " << m_fromLang << llendl;
- m_chat.mText += " (?)";
+ llwarns << "Translation failed for mesg " << m_origMesg << " toLang " << mToLang << " fromLang " << mFromLang << llendl;
+
+ 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);
}
@@ -3371,7 +3374,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