summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2023-02-07 21:42:57 +0000
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-02-08 23:13:58 +0200
commitfee55c892874a4cf6d1739ea2074d18fe94ad574 (patch)
tree8ff55b85056a7ba21cc343afcc39901731d5548d /indra/newview/llviewermessage.cpp
parent1377173dec02e4fae7bb146721462c1939defa1a (diff)
SL-19161 - logging of basic translation stats in ViewerStats
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 5266db5b38..ee237a0af7 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2426,6 +2426,7 @@ void translateSuccess(LLChat chat, LLSD toastArgs, std::string originalMsg, std:
chat.mText += " (" + LLTranslate::removeNoTranslateTags(translation) + ")";
}
+ LLTranslate::instance().logSuccess(1);
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, toastArgs);
}
@@ -2435,6 +2436,7 @@ void translateFailure(LLChat chat, LLSD toastArgs, int status, const std::string
LLStringUtil::replaceString(msg, "\n", " "); // we want one-line error messages
chat.mText += " (" + msg + ")";
+ LLTranslate::instance().logFailure(1);
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, toastArgs);
}
@@ -2669,6 +2671,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
LLSD args;
chat.mOwnerID = owner_id;
+ LLTranslate::instance().logCharsSeen(mesg.size());
if (gSavedSettings.getBOOL("TranslateChat") && chat.mSourceType != CHAT_SOURCE_SYSTEM)
{
if (chat.mChatStyle == CHAT_STYLE_IRC)
@@ -2678,6 +2681,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();
+ LLTranslate::instance().logCharsSent(mesg.size());
LLTranslate::translateMessage(from_lang, to_lang, mesg,
boost::bind(&translateSuccess, chat, args, mesg, from_lang, _1, _2),
boost::bind(&translateFailure, chat, args, _1, _2));