diff options
| author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-08-31 13:47:47 -0700 |
|---|---|---|
| committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-08-31 13:47:47 -0700 |
| commit | 30ff6cabd61f2f083df5df1e6e70cc94742af477 (patch) | |
| tree | 631935f1cf59d19a91cdad65e9a75fe825afda7d /indra/newview/lllogchat.cpp | |
| parent | ff11d74820c89822cd067b51727d9df1dc87d0d0 (diff) | |
| parent | 3ac3a4b206c08ed06b889bdaa24074b6aa0e020a (diff) | |
Merge with trunk
Diffstat (limited to 'indra/newview/lllogchat.cpp')
| -rw-r--r-- | indra/newview/lllogchat.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
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. |
