summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2025-12-04 14:19:04 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2025-12-04 14:19:22 +0200
commita377ec310848657ca6f4b76bdf74aca9cfc6f9da (patch)
treedfb181330de5d5d64981d50171f37c3d0d376ee1 /indra/newview/llstartup.cpp
parent1073444a44c5d0a877fb91dbdde06aa37fea7644 (diff)
parentc4ec3d866082d588de671e833413474d7ab19524 (diff)
Merge branch 'release/2026.01' into maxim/2025.07-Flat-UI
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--indra/newview/llstartup.cpp61
1 files changed, 57 insertions, 4 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index bf7c58a3cb..59d97943e3 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -122,6 +122,7 @@
#include "llpanellogin.h"
#include "llmutelist.h"
#include "llavatarpropertiesprocessor.h"
+#include "llpaneldirbrowser.h"
#include "llpanelgrouplandmoney.h"
#include "llpanelgroupnotices.h"
#include "llparcel.h"
@@ -439,7 +440,52 @@ bool idle_startup()
system = osString.substr (begIdx, endIdx - begIdx);
system += "Locale";
- LLStringUtil::setLocale (LLTrans::getString(system));
+ std::string locale = LLTrans::getString(system);
+ if (locale != LLStringUtil::getLocale()) // is there a reason to do this on repeat?
+ {
+ LLStringUtil::setLocale(locale);
+
+ // Not all locales have AMPM, test it
+ if (LLStringOps::sAM.empty()) // Might already be overriden from LLAppViewer::init()
+ {
+ LLDate datetime(0.0);
+ std::string val = datetime.toHTTPDateString("%p");
+ if (val.empty())
+ {
+ LL_DEBUGS("InitInfo") << "Current locale \"" << locale << "\" "
+ << "doesn't support AM/PM time format" << LL_ENDL;
+ // fallback to declarations in strings.xml
+ LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+ LLStringOps::sPM = LLTrans::getString("dateTimePM");
+ }
+ else
+ {
+ std::wstring utf16str = ll_convert<std::wstring>(val);
+ if (utf16str.size() > 4)
+ {
+ LL_DEBUGS("InitInfo") << "Current locale \"" << locale << "\" "
+ << "has impracitcally long AM/PM time format" << LL_ENDL;
+ // fallback to declarations in strings.xml
+ LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+ LLStringOps::sPM = LLTrans::getString("dateTimePM");
+ }
+ }
+ }
+
+ // Some locales (as well some of our own dateTimeAM/PM) return long
+ // strings for AM/PM which aren't practical to display in the UI.
+ // Hardcode to "AM"/"PM" in those cases.
+ std::wstring utf16str = ll_convert<std::wstring>(LLStringOps::sAM);
+ if (utf16str.size() > 4)
+ {
+ LLStringOps::sAM = "AM";
+ }
+ utf16str = ll_convert<std::wstring>(LLStringOps::sPM);
+ if (utf16str.size() > 4)
+ {
+ LLStringOps::sPM = "PM";
+ }
+ }
//note: Removing this line will cause incorrect button size in the login screen. -- bao.
gTextureList.updateImages(0.01f) ;
@@ -2540,9 +2586,9 @@ void release_notes_coro(const std::string url)
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("releaseNotesCoro", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
+ httpAdapter = std::make_shared<LLCoreHttpUtil::HttpCoroutineAdapter>("releaseNotesCoro", httpPolicy);
+ LLCore::HttpRequest::ptr_t httpRequest = std::make_shared<LLCore::HttpRequest>();
+ LLCore::HttpOptions::ptr_t httpOpts = std::make_shared<LLCore::HttpOptions>();
httpOpts->setHeadersOnly(true); // only making sure it isn't 404 or something like that
@@ -2852,6 +2898,13 @@ void register_viewer_callbacks(LLMessageSystem* msg)
msg->setHandlerFunc("AvatarPickerReply", LLFloaterAvatarPicker::processAvatarPickerReply);
+ msg->setHandlerFunc("DirPlacesReply", LLPanelDirBrowser::processDirPlacesReply);
+ msg->setHandlerFunc("DirPeopleReply", LLPanelDirBrowser::processDirPeopleReply);
+ msg->setHandlerFunc("DirEventsReply", LLPanelDirBrowser::processDirEventsReply);
+ msg->setHandlerFunc("DirGroupsReply", LLPanelDirBrowser::processDirGroupsReply);
+ msg->setHandlerFunc("DirClassifiedReply", LLPanelDirBrowser::processDirClassifiedReply);
+ msg->setHandlerFunc("DirLandReply", LLPanelDirBrowser::processDirLandReply);
+
msg->setHandlerFunc("MapBlockReply", LLWorldMapMessage::processMapBlockReply);
msg->setHandlerFunc("MapItemReply", LLWorldMapMessage::processMapItemReply);
msg->setHandlerFunc("EventInfoReply", LLEventNotifier::processEventInfoReply);