summaryrefslogtreecommitdiff
path: root/indra/newview/lllogchat.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-06-21 08:04:56 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-06-21 08:04:56 +0000
commit9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (patch)
tree4a505c1e0919af52800b3ffb3eaf135e7d6f9ce6 /indra/newview/lllogchat.cpp
parent351ebe9fcb76f3b99c2957004bb8493a904869ee (diff)
merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
Diffstat (limited to 'indra/newview/lllogchat.cpp')
-rw-r--r--indra/newview/lllogchat.cpp29
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.