From eacd9a30bb971b9f84222c67dc54af111cb7918a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 16 Jul 2021 18:08:08 +0300 Subject: SL-15574 If login response provides ISO8601 time, convert to local --- indra/newview/llstartup.cpp | 36 ++++++++++++++++++++++---- indra/newview/skins/default/xui/en/strings.xml | 7 +++-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c5d5be3509..3cbcdce042 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1075,11 +1075,37 @@ bool idle_startup() std::string message_id = response["message_id"]; std::string message; // actual string to show the user - if(!message_id.empty() && LLTrans::findString(message, message_id, response["message_args"])) - { - // message will be filled in with the template and arguments - } - else if(!message_response.empty()) + bool localized_by_id = false; + if(!message_id.empty()) + { + LLSD message_args = response["message_args"]; + if (message_args.has("TIME") + && (message_id == "LoginFailedAcountSuspended" + || message_id == "LoginFailedAccountMaintenance")) + { + LLDate date; + std::string time_string; + if (date.fromString(message_args["TIME"].asString())) + { + LLSD args; + args["datetime"] = (S32)date.secondsSinceEpoch(); + LLTrans::findString(time_string, "LocalTime", args); + } + else + { + time_string = message_args["TIME"].asString() + " " + LLTrans::getString("PacificTime"); + } + + message_args["TIME"] = time_string; + } + // message will be filled in with the template and arguments + if (LLTrans::findString(message, message_id, message_args)) + { + localized_by_id = true; + } + } + + if(!localized_by_id && !message_response.empty()) { // *HACK: "no_inventory_host" sent as the message itself. // Remove this clause when server is sending message_id as well. diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e76f2bd6ba..e98c53ccc2 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -70,6 +70,7 @@ Voice Server Version: [VOICE_VERSION] Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%) [month, datetime, slt] [day, datetime, slt] [year, datetime, slt] [hour, datetime, slt]:[min, datetime, slt]:[second,datetime,slt] + [month, datetime, local] [day, datetime, local] [year, datetime, local] [hour, datetime, local]:[min, datetime, local]:[second,datetime, local] Error fetching server release notes URL. Build Configuration @@ -152,8 +153,10 @@ People with free accounts will not be able to access Second Life during this tim Second Life cannot be accessed from this computer. If you feel this is an error, please contact support@secondlife.com. + + Pacific Time Your account is not accessible until -[TIME] Pacific Time. +[TIME]. If you feel this is an error, please contact support@secondlife.com. We are unable to complete your request at this time. Please contact Second Life support for assistance at http://support.secondlife.com. @@ -161,7 +164,7 @@ Please contact Second Life support for assistance at http://support.secondlife.c Please contact support@secondlife.com. Your account is undergoing minor maintenance. Your account is not accessible until -[TIME] Pacific Time. +[TIME]. If you feel this is an error, please contact support@secondlife.com. Request for logout responded with a fault from simulator. The system is logging you out right now. -- cgit v1.2.3