From 9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Sun, 21 Jun 2009 08:04:56 +0000 Subject: merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3 ignore-dead-branch --- indra/newview/lllogchat.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'indra/newview/lllogchat.cpp') diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 1709d6465d..69214b5cab 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -35,6 +35,7 @@ #include "lllogchat.h" #include "llappviewer.h" #include "llfloaterchat.h" +#include "lltrans.h" const S32 LOG_RECALL_SIZE = 2048; @@ -64,20 +65,26 @@ std::string LLLogChat::timestamp(bool withdate) time_t utc_time; utc_time = time_corrected(); - // There's only one internal tm buffer. - struct tm* timep; + std::string timeStr; + LLSD substitution; + substitution["datetime"] = (S32) utc_time; - // Convert to Pacific, based on server's opinion of whether - // it's daylight savings time there. - timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); - - std::string text; if (withdate) - text = llformat("[%d/%02d/%02d %d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); + { + timeStr = "["+LLTrans::getString ("TimeYear")+"]/[" + +LLTrans::getString ("TimeMonth")+"]/[" + +LLTrans::getString ("TimeDay")+"] [" + +LLTrans::getString ("TimeHour")+"]:[" + +LLTrans::getString ("TimeMin")+"] "; + } else - text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min); + { + timeStr = "[" + LLTrans::getString("TimeHour") + "]:[" + + LLTrans::getString ("TimeMin")+"] "; + } - return text; + LLStringUtil::format (timeStr, substitution); + return timeStr; } @@ -114,7 +121,7 @@ void LLLogChat::loadHistory(std::string filename , void (*callback)(ELogLineType LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "r"); /*Flawfinder: ignore*/ if (!fptr) { - //LLUIString message = LLFloaterChat::getInstance()->getString("IM_logging_string"); + //LLUIString message = LLTrans::getString("IM_logging_string"); //callback(LOG_EMPTY,"IM_logging_string",userdata); callback(LOG_EMPTY,LLStringUtil::null,userdata); return; //No previous conversation with this name. -- cgit v1.2.3