summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-02-08 16:47:07 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-02-08 16:47:07 +0200
commit9b3d316bf51e5615d7259f93aa7acace3df0268e (patch)
treee76b1b61477032ec8b54f8542ca21150d0fb3a70 /indra/newview/llviewermessage.cpp
parente35fc6042e6f15d2d7c26fbfcce8a534eb7f6e16 (diff)
MAINT-6109 Translate some strings received from server
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index e5abbf7683..05e00ea987 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2360,6 +2360,20 @@ static void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::s
}
}
+const std::string NOT_ONLINE_MSG("User not online - message will be stored and delivered later.");
+const std::string NOT_ONLINE_INVENTORY("User not online - inventory has been saved.");
+void translate_if_needed(std::string& message)
+{
+ if (message == NOT_ONLINE_MSG)
+ {
+ message = LLTrans::getString("not_online_msg");
+ }
+ else if (message == NOT_ONLINE_INVENTORY)
+ {
+ message = LLTrans::getString("not_online_inventory");
+ }
+}
+
void process_improved_im(LLMessageSystem *msg, void **user_data)
{
LLUUID from_id;
@@ -2424,6 +2438,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
chat.mFromID = from_id;
chat.mFromName = name;
chat.mSourceType = (from_id.isNull() || (name == std::string(SYSTEM_FROM))) ? CHAT_SOURCE_SYSTEM : CHAT_SOURCE_AGENT;
+
+ if (chat.mSourceType == CHAT_SOURCE_SYSTEM)
+ { // Translate server message if required (MAINT-6109)
+ translate_if_needed(message);
+ }
LLViewerObject *source = gObjectList.findObject(session_id); //Session ID is probably the wrong thing.
if (source)